Camera Projection Rendering Toolkit is a plugin that bring some projection & anti-aliasing functionalities:
- Wide field of view perspective with non-linear projections techniques
This plugin introduce Stereospherical (Fisheye) and Pannini perspective technique that solve the deformation that can occur with a wide field of view on objects far from the center of the screen.
I let you judge with these comparative 110° FOV screenshots:
StereoSpherical “Fisheye”: this perspective projection is the mathematically most accurate imitation of what the human eyes see.
Pannini: Inspired by the painter Giovanni Paolo Pannini, this perspective projection isn’t very realistic but allows the drawing of wide panorama and gives a pretty good feeling of being small relative to the architectural structures. It has the advantage of keeping the linearity of vertical lines. This projection can be free or horizon-aligned to prevent strange deformations.
These non-linear perspective projections gives more space to the objects in the center, which has the effect of “zooming” the center pixels. This is why I needed to oversample the rendering with SSAA to avoid blurred/pixelated image. You can expect FPS drops if you use very wide FOV because of the oversampling (110° needs x1.6 SSAA, so a 1920x1080 rendering viewport will become a 3072x1728 one).
Warning : this is not intended for VR.
- Super-Sampling Anti-Aliasing (SSAA) / Pixelization
The plugin allows you to add SSAA to take high resolution screenshots and to add high quality Anti-Aliasing even in deferred rendering (which isn’t supported by Unity’s MSAA).
It can be GPU-heavy but this Anti-Aliasing improve image quality on the entire surface, including edges and opaque/transparent textures.
SSAA quality is currently limited to 2x, which is equivalent to a “better” MSAA 4x. It’s quite enough for real-time purposes and can be improved with other Anti-Aliasing techniques.
It can also pixelize the image to give it a classic “Quake-like” feel.
- Oblique orthographic projections
If you’re not looking for perspective, this plugin can produce oblique orthographic projection and will help you give a more classic look to your game/project.
This screenshot shows you the 4 obliques preset, but you can customize them.
-
The plugin hasn’t been tested with VR yet
-
It can take high resolution screenshots.
-
The whole plugin is compatible with image effects (glow, FXAA, SMAA…)
-
The final resolution is limited to 16384x16384 pixels (8192x8192 on older hardwares).
-
Interactive inspector window (automatic buttons, warnings)
-
Works with multiple cameras, render textures, forward and deferred rendering, linear and gamma color space, post-processing effects (HDR, Bloom, FXAA…)
-
Tested with Unity 5.6.1 and 5.3.0, not compatible with Unity 5.6.0
-
Comes with PDF documentation and exemple scenes (those seen in screenshots)
-
Supports picking
ChangeLog
-1.6
- Added the pseudo orthographic projection which mimics an orthographic projection with a perspective in order to allow deferred rendering with an orthographic projection.
- removed a bug when disabling the CPRT component.
- removed bugs in the CPRT editor.
-1.5.1 : - Improved CPRT compatibility with various external post-process plugins
- Added an optional CPRTFrustumUpdater script :
- Some external plugins can interact with the camera during the “OnPreCull” Unity callback, and may be in conflict with CPRT. CPRTFrustumUpdater allows to reorder the CPRT camera handling, and should typically be first so the other scripts can work on CPRT camera settings.
- Oversampling setting interface has been slitghly reworked :
- You’ll likely need to reconfigure the oversampling in your scenes,
- To make the setting clearer you now have two sliders : you can either set the render size multiplier or the Min Pixel Samples Count (minimal oversampling in the screen, 1 ensures that the image won’t be downsampled at any place even with non-linear projection, 4 produce SSAAx2),
- programatically, oversamplingFactor stays unchanged but is deprecated, please use renderSizeFactor instead from now on. The minimal oversampling in the screen can be set with the MinPixelSampleCount property,
- Those changes applies to screenshot settings.
v1.5 : - New “Screenshot Pass Count” settings :
- Use screenshotPassCount to do successive rendering to help troubleshooting post-processing effects which accumuate samples over frames (like some ambient occlusion or global illumination effects do).
- Set screenshotPassImproveSSAA to true to gather more antialiasing samples (for a maximum of 64 samples with SSAAx2 enabled).
- Fixed a compatibility issue with SonicEther’s SEGI effect.
- Enabling / disabling the script should no longer make the camera unusable.
- FOV can now be changed without calling RefreshEffect and RefreshViewport.
- Added a CPRT.WorldToViewportPoint method (equivalent of Camera.WorldToViewportPoint), it will help you to project a world point into the screen.
v1.4 : - Added support for AdaptivePannini camera-picking.
- Adaptive Pannini has been fixed to keep viewport center at screen center, and to feel more natural.
- CPRT control panel doesn’t overstep the inspector width anymore.
v1.3 : - Added support for camera-picking :
- ScreenPointToRay and ViewportPointToRay are two new method that can help you to pick object from your camera while taking into account the projection distortion,
- New showcase scene “MultiCamera Picking”,
- Supported projections are the “Stereospheric” and the “Pannini”, support for AdaptivePannini will come later.
- New script “AutoOversamplingScript” which adapt oversampling quality in real-time in accordance with the framerate,
- Added Diagonal FOV setting (real-life camera common characteristic),
- New property “RenderingFramerate” which gives the duration between two actual rendering.
v1.2 : - fixed bugs when releasing executable with the plugin
- made the documentation more user-friendly
- added a TempRenderTextureManager.cs script that can help you to setup post-CPRT effects
- added two test scenes
- Surveillance Screens: demonstrate how to setup realtime render texture
- Post-CPRT FX: demonstrate how to setup a post-CPRT chromatic aberration effect
v1.1 : - added Horizontal FOV setting,
- fixed some issues with render textures, you can no longer use the classic “Camera.targetTexture” parameter, you must use the script’s “targetTexture” one,
- fixed a memory leak and did some optimisations.
I’m trying to make this plugin as simple as possible. Don’t hesitate if you have suggestions, questions, requests or if you encounter any issue.