---
title: "V-Ray Z-Depth"
canonical: "https://documentation.chaos.com/space/VRAYHOUDINI/113280714/V-Ray+Z-Depth"
format: markdown
---
The Z-Depth Render Channel is a grayscale image that renders each pixel based on its distance from the camera in the view. 


## **Overview**

---

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 Channel is as a control for depth of field in the composite. Depth of field can be challenging to do correctly within Houdini, requiring many tweaks and re-renders; using the Z-Depth Render Channel in a composite is usually much faster, and allows easier and faster adjustment than trying to get it exactly right within the render from Houdini.

**Note:** Specific objects can be excluded from this Render Channel by disabling the **Generate Render Elements** option in the V*RayObjectProperties* node for the selected object(s).

![image](media://c754a13a-bea2-4662-988e-9bbc0208cc89)


## **Parameters**

---

The parameters for this render channel appear in the Parameters tab under the out Network and within the render elements node.

**Name **– <span style="color: #000000">The text added to the end of the rendered file, when saved as a separate file (e.g. myrender.Z-Depth.vrimg).</span>

<span style="color: #000000">**Deep Output**</span><span style="color: #000000"> – Specifies whether to include this render element in deep images.</span>

**Use Depth From 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 Clamp** – Clamps the Z-Depth colors to a linear 0-1 range.

**Depth Black** – Objects further than this distance from the camera render as black. This option is available only when **Use Depth From Camera** is disabled.

**Depth White** – Objects up to this distance from the camera render as white. This option is available only when **Use Depth From Camera** is disabled.

**Filtering** – Applies the image filter to this channel. Image filter settings are in the [AA sub-tab](https://docs-chaos.atlassian.net/wiki/spaces/VRAYHOUDINI/pages/113279287) of the [Sampler tab](https://docs-chaos.atlassian.net/wiki/spaces/VRAYHOUDINI/pages/113279757) of the [V-Ray Renderer](https://docs-chaos.atlassian.net/wiki/spaces/VRAYHOUDINI/pages/113279154) node.

**Depth Invert** – Inverts the colors of the Z-Depth render element. Objects closest to the camera render as white, while those furthest away are black.

**Zero Infinity Depth** – When enabled, sets infinite depth value to 0.0.

![image](media://7c4fbad5-28c4-488e-85ee-c3a063a767cb)


## **Invert zdepth**

---

<span style="color: #000000">The </span><span style="color: #000000">**Depth Black**</span><span style="color: #000000"> and </span><span style="color: #000000">**Depth White**</span><span style="color: #000000"> values in the Z-Depth Render Element can be inverted by enabling the </span><span style="color: #000000">**Depth Invert**</span><span style="color: #000000"> option.</span>

<span style="color: #000000"> </span>

![image](media://eaa93f2d-fec6-49d5-abb0-1f5ead2cd0bb)

ON

![image](media://52cbb025-2ea7-4245-adb1-0d8f7f615620)

OFF



## **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.


![image](media://789988a5-3590-4dfe-98fe-5391db31213f)

Depth of field applied to composite using Z-Depth Render Element

![image](media://3aa11025-3a4e-444d-8f44-05b4f3b2b76f)

Original Beauty Composite

![image](media://7a0bffa0-cb33-4e2a-8cf9-d91471e1c171)

Basic fog applied to composite using Z-Depth Render Element