Aller au contenu

Z to Disparity Node

By Kriss Norde

Z to Disparity converts a Z-depth channel + stereo camera data into a disparity map. It gives you a physically accurate disparity on CG renders (which have native Z), better than the classic Disparity node, which has to estimate the disparity through stereoscopic analysis.

Overview

Z to Disparity uses the geometric relationship between Z (camera distance) and disparity (the horizontal offset between the left and right eyes). With the precise stereo camera data (interaxial, convergence), it computes the disparity mathematically rather than guessing it.

The benefit: a clean disparity map, without analysis artifacts (occlusions, low contrast, baked-in motion blur). Critical for every 3D stereo VFX workflow that relies on the disparity afterward.

Where to find this node

  • Effects Library: Tools > Stereo > Z to Disparity
  • Quick add: right-click in the Node Editor → Add Tool > Stereo > Z to Disparity

Z to Disparity vs Disparity

Disparity
Estimates the disparity through stereoscopic analysis of two L/R images. Works on live action and on CG without native Z. Possible approximations, artifacts on difficult surfaces.
Z to Disparity
Computes the disparity from the Z-depth + camera parameters. Mathematical precision. Requires a native Z channel (so a CG render).

Rule of thumb: live action stereo → Disparity (the only option). CG stereo with exported Z → Z to Disparity (more precise).

Inputs

  • Left Input (orange) - the left view (or a stacked image).
  • Right Input (green) - the right view (visible when Stack Mode = Separate).
  • Stereo Camera (magenta) - a stereo perspective camera (Camera 3D with eye separation, or tracked L/R Camera 3D nodes).

Setup

CG render with Z + Stereo Camera:
Render Left ─┐
             │
Render Right ┴── Z to Disparity ──┐
                                  ↓
Stereo Camera ────────────────────┤
                                  ↓
                          Disparity → New Eye / Stereo Align

Disparity output to RGB for debugging:
Render → Z to Disparity (Output Disparity to RGB = On)
      → MediaOut (disparity shown in color)

3D stereo VFX pipeline:
CG L + R + Stereo Camera → Z to Disparity (precise)
                        → New Eye (interpolation)
                        → MediaOut

Controls tab

Output Disparity to RGB (default: Off)
When on, outputs the disparity values in the RGB channels ({x, y, 0, 1}). Automatically promotes RGBA to float32. Handy for visual debugging.
Refine Disparity (default: Off)
Enables a refinement based on the RGB channels (matching the Z edges to the RGB edges).
Strength
Smooths the depth in constant regions. Correlates the Z edges with the RGB edges.
Radius
Radius in pixels of the smoothing algorithm.
Stack Mode
Determines whether the L/R outputs are identical (Stacked) or separate (Separate).
Swap Eyes (default: Off)
Swaps the left / right outputs.

Camera tab

Camera Mode
External: uses the connected stereo camera (real data). Artistic: custom values for compositing approximations.
Convergence Point
The Z distance where disparity = 0. The screen plane.
Background Disparity
The maximum disparity for distant objects (relative to the left eye).

Use cases

  • Precise disparity for CG renders - native Z available: Z to Disparity gives a much cleaner disparity than the classic Disparity analysis.
  • 3D stereo VFX pipeline - professional 3D stereo compositing benefits from an exact disparity for New Eye, Stereo Align, etc.
  • Matching disparity to existing footage - Artistic mode lets you adjust the disparity of an added CG asset to match the depth of live action stereo footage.
  • Fixing Disparity artifacts - when the classic Disparity generates artifacts, fall back on Z to Disparity if native Z is available.
  • Debug visualization - Output Disparity to RGB = a colored view of the disparity for visual checking.

Tips

  • External for real precision - External mode uses the real camera data of the stereo rig. Always prefer it for mathematical accuracy.
  • Artistic for approximations - no known stereo camera, or you need a custom look: Artistic mode lets you improvise.
  • Balanced Strength - too high = stray texture artifacts in the disparity channel. Keep it modest unless you have a specific need.
  • Radius based on resolution - adjust it in proportion to the resolution. Higher resolution = a larger radius for an equivalent effect.
  • 32-bit float for precision - the disparity channels must stay in float for precision. Output to RGB promotes automatically, but check the bit depth downstream.
  • Cache the output - the calculation can be heavy. Cache it to avoid recomputing downstream.
  • For hybrid workflows (CG + live action), combine Z to Disparity (CG) with Disparity (live) depending on the source of each element.