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; using the Z-Depth Render Element in a composite is usually much faster, and allows easier and faster adjustment.

Depth Black – in a Z-depth element a black distance is the distance closest to the camera. This parameter allows you to specify how far from the camera the z-depth element starts.

Depth White – in a Z-depth element a white distance is the distance farthest away from the camera. This parameter allows you to specify how far from the camera the z-depth element ends.

Invert – 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.

Depth From Camera -when enabled the Depth Black and Depth White are taken from the far and near clipping plane of the camera

Depth Clamp – allows you to enable or disable the the sampling of the current render channel for antialiasing

Filtering – enables or disables the AA filtering for the current render channel

Example: Invert zdepth

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

Common Uses

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