How to add your knowledge

ZDepth render pass (Everything about it)

    Table of contents
    No headers

    Version as of 13:00, 24 May 2013

    to this version.

    Return to Version archive.

    View current version

    Note: All information on this page is based on the 2012 Extension 1 release.

    The ZDepth render pass have for goal to provide for each pixels the relative distance of each objects in the scene to the camera that was used to perform the rendering. This information is stored in the render pass as a luminance value creating a grey scale representation of the scene. ZDepth range can be exposed in different ways in terms of color value range and file format bit depth, but floating point file format(16bit or 32bit) offer much more precision. The most common format are usually refered as White is Near and White is Far.

    White is Near

    This ZDepth render format essentially means that white colour is used to represent object right at the camera level and further away they get, darker colour up to black is used to represent them. Usually this format is normalized and the camera position will be represented by a white value of 1.0(for 16 or 32 bit file format) and black of 0 would be the further away object could be based on the camera Near and Far value.

    White is Far

    This ZDepth render format is more common and used for example by Maya Mental Ray or Flame/Smoke Action render engine. In this case Black colour value represent object right at the camera level and further away they get, lighter colour is used to represent them. Two format here are quite common here: Normalized and Absolute. Absolute is normally what you will get from renderer like Mental Ray when using OpenEXR as rendering file format. What this means is that white value aren't cliped at 1.0 and colour value are actually representing real scene scale metrics resulting in huge luminance colour range. Normalized is what is used by the Action render engine. In this case the camera Near and Far value are map to 0 and 1 colour value where and black at 0 represent the Near clipping plane and a white at 1.0 represent the Far clipping plane.

    How do I know what ZDepth format I'm dealing with?

    • If your ZDepth render pass appears as an opaque white frames it probably means it is in Absolute White is Far format, but to make sure either use an histogram or an Exposure offset which will allow to display really high white values.
    • In Normalised format to identify if it is White is Far or White is Near identify in your scene an object that is close to the camera and one that is far and look at the colour luminance variation, if darker is closer than it is White is Far and if lighter is closer it is White is Near.
    • If you have any doubt about the colour range or format, the CC or 2D Histo node histogram is your best friend since as state above ultimately ZDepth information could be stored in any luminance colour range.

    Where do I get ZDepth render pass?

    • 3D renderers such as Mental Ray are able to generate this render pass. It's best to ask for Open EXR renders since it offers more precision in the depth values.
    • Flame/Smoke Action module and Batch node can output a ZDepth render representing scene object Z positioning.
    • Flame/Smoke Matchbox Matte to ZDepth preset allow to use up to 5 mattes combined with a gradient to create a custom ZDepth out of live footage.

    What can I do with a Zdepth render pass?

    Depth Of Field:

    This module and Batch node allow to create depth of field effect based on the ZDepth input information. Due to the algorithm use you are required to use ZDepth information contains in between 0 and 1.0. You can use the Depth O Gram  Offset and Scale parameters to bring into this range the required depth information to perform the desired effect.

    MatchBox ZRays

    This Matchbox preset allows to create volumetric rays in your scene base on the ZDepth input information.

    MatchBox ZGlow

    This Matchbox preset allows to create glowing effect in your scene base on the ZDepth input information.

    MatchBox ZFog

    This Matchbox preset allows to integrate fog type of effect in your scene base on the ZDepth input information.

    MatchBox ZComp

    This Matchbox preset allows to integrate a video input using it's matte into a scene base on it's ZDepth information. This could be use for example to integrate a text element or a logo anywhere into a rendered scene. This preset also allow to create a new ZDepth pass base on the integration, so it could be further used for other ZDepth effect type.

    MatchBox ZMatte

    This Matchbox preset allows to extract a matte from a ZDepth input information. This could be used for example separate object from a rendered scene for further processing.

    3D Blur:

    The 3D Blur Batch node allows to create depth of field effect based on ZDepth input information. 

    What problems can I encounter with ZDepth render pass?

    • Filtering. One important point is that ZDepth render pass need to not be Anti-Aliasing or include any filtering. Since it is an absolute per pixel measurement, it can't contain filtering otherwise it will create all kind of problems on the edges when applying effects. Also it would be a bad idea to use a compress file format to carry that information.
    • Edges problem. On the other end since it doesn't contain filtering it can create hard edges when object close to the camera aren't included in the effect since they will be cut out by that aliased ZDepth information. This problem is actually a limitation of the technique and need to be deal with on a tool by tool basis, so when seeing these kind of artefacts be on the look out for controls like softening or edge expansion or blending.