Keywords: main

Next: 2.2 Light Shader: physical_light Up: 2. Physics Shaders/A> Previous: 2. Physics Shaders/A>

# 2.1 Lens Shader: physical_lens_dof

This lens shader simulates depth of field by casting multiple eye rays into the scene such that an object at the focal distance is sharp and in focus, while objects at other distances are blurred. This shader is available only with the physics shader library included with mental ray 2.1.

        color "physical_lens_dof" (
            scalar          "plane",
            scalar          "radius")

plane is the focal distance at which objects appear in focus. More precisely it is the negative Z coordinate of the focus plane in camera space. It must be a positive number.

radius is the radius of confusion at the camera's focal distance. Larger numbers increase the blurring effect. Note that typical values are small, and large values can reduce the entire scene to a noisy cloud.