This page gives information about the Z-Depth Render Element.
The Z-Depth Render Element is a grayscale image that renders each pixel based on its distance from the camera in the view. It 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 3ds Max, 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 3ds Max.
UI Path: ||Render Setup window|| > Render Elements tab > Add button > VRayZDepth
This render element is enabled through the Render Elements tab of the Render Setup window in 3ds Max and displays its parameters in a rollout at the bottom of the window:
vrayVFB – When enabled, the Z-Depth pass appears in the V-Ray Frame Buffer.
deep output – Specifies whether to include this render element in deep images.
zdepth use camera clip boundaries – Specifies whether to use to camera clip boundaries as the minimum and maximum Z-Depth distance. Enabling this option disables the zdepth min and zdepth max parameters.
zdepth min – Objects up to this distance from the camera will render as white. This option is available only when zdepth use camera clip boundaries is disabled.
zdepth max – Objects further than this distance from the camera will render as black. This option is available only when zdepth use camera clip boundaries is disabled.
clamp zdepth – Clamps the Z-Depth colors to a linear 0-1 range.
invert zdepth – Inverts the colors of the Z-Depth render element. Objects closest to the camera will render as black, while those furthest away will be white.
Z-Depth Minimum and Maximum
The Z-Depth Render Element parameters for minimum and maximum depth, zdepth min and zdepth max, can be set to various values to provide different ranges of depth in the render element. In these examples, clamp zdepth is enabled and invert zdepth is disabled.
zdepth min = 0cm, zdepth max = 2404.603cm
zdepth min = 400cm, zdepth max = 2404.603cm
zdepth min = 600cm, zdepth max = 2404.603cm
zdepth min = 0cm, zdepth max = 1000cm
zdepth min = 0cm, zdepth max = 600cm
The black and white values in the Z-Depth Render Element can be inverted by enabling the invert zdepth option.
Invert zdepth enabled
Invert zdepth disabled
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.
Original Beauty Composite
Depth of field applied to composite
using Z-Depth Render Element
Basic fog applied to composite
using Z-Depth Render Element