Converting Disparity to Depth

CaraVR includes a gizmo tool, C_DisparityToDepth, designed to convert disparity to a depth map. Depth maps can be useful in compositing when you're placing 3D objects in a scene. Getting the depth right can help achieve a more realistic look.

As the name of the node suggests, C_DisparityToDepth requires a disparity map to make the conversion, so follow the steps outlined in Generating Disparity Vectors before starting.

To convert disparity to depth:

1.   Add a C_DisparityToDepth gizmo downstream of a C_DisparityGenerator.
2.   Set the Left View and Right View controls to the views containing the disparity channels.
3.   Click the Viewer channels dropdown and select the depth channel.

The depth map displays.

4.   Use the view buttons to switch between the left and right views.

Note:  C_DisparityToDepth uses the GPU to calculate depth by default, but it falls back to Vectorized CPU calculation if the GPU can't be found.

5.   Adjust the Eye Separation control to determines how far apart the two views are, from a viewer's perspective. If you set the Eye Separation, or interpupillary distance (IPD), too low, objects in the scene appear crushed horizontally, but raising it too high can leave holes in the stitch.

Note:  Eye Separation is measured in the same units as the Rig Size control in the upstream C_CameraSolver properties, so adjust it accordingly.

6.   Enable Z Inverse to reverse the way depth is represented in the image, which can produce smoother depth maps. The inversion treats smaller values in the image as greater depth, rather than the default where small values equal less depth.

The Min Encodable Depth slider controls the cutoff point for depth calculations.

7.   Adjust the Separation Falloff to control how smoothly views are merged towards the poles. Reducing the falloff shifts the transition in depth towards the poles.

A value of 1 produces smooth merging toward the poles for the left and right views. Reducing the value pushes the merge point toward the poles, a value of 0 disables pole merging entirely.

When you're happy with the depth map, you can use it in various compositing workflows such as simulating depth-of-field blurring. See the Nuke Online Help for more information.