The depth pass isolates depth information. When composited with the rest of the scene, it applies a fog or depth fading to objects that are farther from the camera. The depth pass creates a black and white gradient based on depth information using a volume shader. White represents a distance close to the camera, and black is very far. A depth map’s color and unit scaling can be customized.
The depth pass includes the following settings:
• Background Objects Partition—contains all of a scene’s objects. These objects have the Z-Depth shader applied to them via the partition. This shader only renders the depth information of every object in the partition.
• Background Lights Partition—automatically includes all lights for the scene.
To set up the depth–pass preset
1. Load the depth–pass preset from the Render toolbar by choosing Pass > Edit > New Pass > Depth. A depth pass for the entire scene is created and the Pass property editor appears.
2. Rename the depth pass and, if you wish, set the active camera and rendering options. For general information about choosing rendering options, see Managing Rendering Options.
3. To edit the depth–pass parameters, click the Volume Shader tab in the depth–pass property editor.
4. Select the Constant Density shader from the shader stack and press Inspect to open the Constant Density property editor. You can define the unit scaling of the depth pass.
Scaling determines the depth used to display Density. Use 1:100 to create a detailed depth pass of a scene that extends far from the camera and 1:1 for a scene that is relatively flat.
For specific information about each of the options in this property editor, refer to Constant Density by clicking
in the property editor.
5. If not already set, change the 3D view to view the render pass by selecting Cameras > Render Pass.
6. When you are satisfied with the settings, preview a fully rendered frame by choosing Render > Preview > All Layers from the Render toolbar.
7. Render the pass. For more information on how to do this, see Rendering Methods.
Some target formats, such as the ones used in games development, require that depth information be “flat”. That means that the depth is constant for each object, rather than falling off smoothly. You can flatten a depth pass using the Flatten Depth output shader.
To flatten a depth pass
1. Create a depth pass, as previously described.
2. Edit the depth–pass parameters, click the Output Shader tab in the depth–pass property editor.
3. Click the Add button next to the Output shader stack and select the Flatten Depth shader from the browser. The shader is added to the pass’ Output shader stack.
4. Select the Flatten Depth shader in the shader stack and click the Inspect button to open its property editor.
5. From the Flatten Depth property editor, set the Depth Mode option to flatten each object’s depth according to one of the following criteria:
- Not flatten: does not flatten the depth.
- Average: flattens each object's depth using its average depth value.
- Maximum: flattens each object's depth using its maximum depth value.
- Minimum: flattens each object's depth using its minimum depth value.
6. Enable the Camera Space Depth option to convert the depth data from raster space to camera space.
Autodesk Softimage v.7.5