The Z-Depth Render Element is a grayscale image that renders each pixel based on its distance from the camera in the view.
The Z-Depth Render Element provides information about each object's distance from the camera in the current view. Each pixel representing the object is evaluated for distance individually; different pixels for the same object can have different grayscale values. In this render element, objects (or portions of objects) closest to the camera appear as white while those furthest away appear black. Objects between the furthest and nearest points are rendered in varying shades of gray. The lighter the gray, the closer an object pixel is to the camera.
The most common usage of the Z-Depth Render Element is as a control for depth of field in the composite. Depth of field can be challenging to do correctly within Maya, requiring many tweaks and re-renders; using the Z-Depth Render Element in a composite is usually much faster, and allows easier and faster adjustment than trying to get it exactly right within the render from Maya.
Note: Specific objects can be excluded from this Render Element by disabling the Generate Render Elements option in the VRayObjectProperties node for the selected object(s).
UI Path: ||Render Settings window|| > Render Elements tab > Z-depth
The parameters for this render element appear in the Attribute Editor under Extra V-Ray Attributes.
Enabled – When checked, the Z-Depth pass appears in the V-Ray Frame Buffer.
Deep output – Specifies whether to include this render element in deep images.
Use depth from the camera – Specifies whether to use to camera clip boundaries as the minimum and maximum Z-Depth distance. Enabling this option disables the Depth Black and Depth White parameters.
Depth Black – Objects further than this distance from the camera will render as black. This option is available only when Use depth from the camera is disabled.
Depth White – Objects up to this distance from the camera will render as white. This option is available only when Use depth from the camera is disabled.
Depth Clamp – Clamps the Z-Depth colors to a linear 0-1 range.
Filename suffix – The text added to the end of the rendered file, when saved as a separate file (e.g. myrender.zDepth.vrimg).
Depth Black and Depth White
The Z-Depth Render Element parameters for minimum and maximum depth, Depth Black and Depth White, can be set to various values to provide different ranges of depth in the render element. In these examples, clamp zdepth is enabled.
Black = 368, White = 31900
Black = 1552, White = 31900
Black = 0, White = 17740
Black = 0, White = 4090
Use depth from the camerahas been turned on
The Z-Depth Render Element is useful for adding depth of field to the final image in post production using a compositing application without the need for re-rendering. It can also be used to create basic fog by overlaying it on the composite with Add mode or Screen mode, with color correction as needed.
ZDepth Render Element
Original Beauty Composite
Depth of field applied to composite
using Z-Depth Render Element
- The Z-Depth Render Element will always be written as a 32-bit channel for multichannel .exr files. Even when outputting a 16-bit multichannel .exr, the Z-Depth channel will be 32-bit while the other channels will be 16-bit.