Lens Effects

 
 
 

| Render Tree Usage

Category: Lens

Shader Family: Lens

Output: Color

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.

Fisheye

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.

Enable

Activates fisheye distortion.

Distortion

Adjusts the degree of fisheye distortion. A value of 0.0 effectively "flattens" the lens, while a value of 1.0 results in completely hemispherical distortion.

Distortion is relative to the pass camera's field of view (FOV). Hence, only if FOV is set to 180 degrees, and Distortion to 1.0, will the lens be truly hemispherical.

You can adjust the pass camera's field of view from the Camera property editor.

Scale

X/Y

Adjust the proportions of the image in X and Y.

Uniform

When activated, the X and Y scale values are kept identical, and changing them zooms into or out of the image uniformly. Zooming out reveals an undefined (black) area outside of the area covered by the lens.

Bulge

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.

Enable

Activates bulge distortion.

Amount

Adjusts the amount of bulge distortion. A value of 0.0 effectively disables the bulge effect, while a value of 1.0 results in the full effect (as determined by the Magnitude sliders).

Magnitude

X/Y

Control horizontal and vertical bulge, respectively. Using the Render Tree it is possible to generate scalar values for these parameters by mapping a procedural texture (GradientGradient_Mixer, for example) to screen space, using the Texture Space GeneratorPreset node to compute screen coordinates for each eye ray.

Render Tree Usage

This shader can be applied directly to the camera in the lens shader stack. See Applying Lens Shaders to Cameras [Cameras and Motion Blur].