The Lens Effects shader allows for a variety of lens-distortion effects useful for simulating distorted perspectives often found in hand-drawn artwork and non-photorealistic rendering.
This fisheye parameters simulate a hemispherical (fisheye) lens capable of rendering a 180-degree field of view with characteristic hemispherical distortion typical of real-world fisheye lenses. This shader does not attempt to implement some of the less desirable (and less predictable) traits of fisheye lenses, such as chromatic and spherical aberrations; in that sense, this is an "ideal" fisheye lens.
This shader is compatible with the pass camera's lens center offset controls, so it should be possible to achieve Omnimax style fisheye images (where the lens center is near the bottom of the screen).
Furthermore, the horizontal/vertical proportions of the lens hemisphere are not coupled to the camera aspect ratio (with the legacy fisheye lens shader, changing the camera aspect ratio resulted in a corresponding change in the shape of the lens hemisphere). Rather, this shader's scale parameters permit independent scaling of the fisheye lens' X and Y axes.
The bulge parameters allow "bulging" of the lens by altering eye-ray direction. The lens may bulge out (convex, like a fisheye lens) or bulge in (concave). This effect may vary over the surface of the lens, and is best controlled via the Render Tree.
This shader can be applied directly to the camera in the lens shader stack. See Applying Lens Shaders to Cameras [Cameras and Motion Blur].
Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License