V-Ray Tip: V-Ray Z‑Depth for Clean Post DOF

March 05, 2026 2 min read

V-Ray Tip: V-Ray Z‑Depth for Clean Post DOF

Depth of field in post gives you creative freedom without re-rendering. Here’s how to get dependable Z-Depth from V-Ray and turn it into clean, controllable DOF in compositing.

  • Add the VRayZDepth render element.
    • Set Depth black to the near-focus distance (in scene units) and Depth white to the far limit.
    • Enable Clamp ZDepth to confine values to your chosen range; disable it if your comp relies on the full, unclamped distance.
    • If you see jagged edges in the Z-pass, enable Filtering in the element to anti-alias it. Note: filtering slightly compromises mathematical precision but often improves comp results at silhouettes.
  • Render to a 32‑bit EXR.
    • Use multilayer EXR to keep Beauty and ZDepth together; choose 32‑bit float or 16‑bit half-float depending on range and precision needs.
    • Avoid baking tone mapping or color corrections into ZDepth. Keep it linear and ungraded.
  • Pick sensible ranges by scene type.
    • Interiors: Depth black ≈ 0.5–2 m, Depth white ≈ 10–30 m.
    • Exteriors: Depth black ≈ 1–5 m, Depth white ≈ 100–500 m.
    • Place Depth white slightly beyond the farthest object you care about, so background hits pure white for strong separation.
  • Compositing workflow (Nuke/Fusion/AE/Photo apps).
    • Unpremultiply the Beauty before defocus, repremultiply after.
    • Use a depth-aware blur (Nuke ZDefocus, Fusion DepthBlur, After Effects Camera Lens Blur).
    • Invert the ZDepth if your tool expects white‑near/black‑far (conventions vary).
    • Dial focus by sampling the Z value at your focus object; then adjust F‑stop/blur size to taste.
    • For bokeh shape, use an aperture image or iris blades in the node if supported.
  • Avoid common artifacts.
    • Banding: always work in 32‑bit; add a tiny pre-blur (0.5–1 px) on the Z-pass if needed.
    • Edge halos: ensure ZDepth is filtered; consider edge-extend or matte choking on holdouts.
    • Transparency: for glass or hair, render supplementary mattes or use a separate comp pass—ZDepth doesn’t understand refractive depth.
    • Order of operations: apply motion blur and DOF in a 2.5D pipeline carefully; if both are in post, test the order (often MB first, then DOF) to minimize artifacts.
  • When to prefer in-render DOF.
    • Heavy refraction/caustics, complex translucency, and true specular bokeh are more accurate with camera DOF. Use post DOF for speed and iteration; switch to in-render for final hero shots if necessary.
  • Extra mileage from your Z-pass.
    • Drive atmospheric haze or color grading by depth to reinforce scale.
    • Blend sharpen-by-depth to keep the subject crisp while softening the background.

Pro tip: Save a few ZDepth presets (near/mid/far) in your template scenes to cover most setups, and you’ll iterate focus in seconds without a re-render.

If you’re equipping your studio with V-Ray or upgrading, check out NOVEDGE for licensing options and bundles. For more V-Ray production tips and workflow insights, follow NOVEDGE and keep your toolkit current via NOVEDGE.



You can find all the V-Ray products on the NOVEDGE web site at this page.







Also in Design News

Subscribe

How can I assist you?