Rendering a Depth Pass


There are several ways to render a depth pass with Air.  Here are two that work with an existing set of rib files (so you do not need to set up a separate render pass in Massive or export an additional set of files).

Method 1:  Save the standard depth buffer z as the output image.  First, create a small text file with the following commands:

    Display "depth#4f.tif" "file" "z"
    Option "render" "commands" "-Display"
    Option "render" "zrange" [1000 10000]

The zrange option sets the minimum and maximum depth values which correspond to 0 and 1 respectively in the exported z value.  If you wish to save raw depth values, omit the line that sets the zrange option.

Then render from a command shell including the extra file prior to main scene name:

    air zdepth.rib scene0001.rib

For a sequence use:

    air -frames 1 100 zdepth.rib scene#4f.rib

Method 2:  Render a depth gradient using Air’s depthpass surface shader.  As in method 1, first create a small text file with a few RIB commands:

    Display "depth#4f.tif" "file" "r"
    Option "render" "commands" "-Display"

    Surface "depthpass"
      "mindistance" 1000
      "maxdistance" 10000

    Option "render" "commands" "-Surface"

Then include the extra file on the command line:

    air depthpass.rib scene0001.rib



© 2001-13 SiTex Graphics, Inc.  All rights reserved.