Houdini 12 Rendering

Overview

You can include extra image planes (also called deep rasters) containing image representations of VEX (the mantra shading language) global variables, or exported variables/parameters from any surface or fog shader.

You can even output extra planes per light if you assign the exported variable inside an illuminance loop.

When rendering to a .pic (Houdini image format) or .exr (OpenEXR) format image (or the special ip name, which outputs to MPlay instead of a file) you can include the extra planes in the same multi-plane image as the main render. You can also specify that extra planes go into multiple separate files (or put multiple extra planes in a separate multi-plane file from the main render).

Examples

For example, you can export the value of the global variable N (surface normal) for each pixel to an image.

The rendered color plane: a torus lit from above.

The N plane, showing the surface normals as color.

(You can view the extra plane(s) in MPlay using the popup menu in the top left under the toolbar.)

Another example: Houdini’s basic surface shader exports a variable named paintExport, containing the shader’s color contribution before lighting. This can be very useful information to have during compositing.

The rendered color plane: a torus lit from various angles, with point colors.

The paintExport plane, showing the surface shader’s original color contribution before lighting and shadows.

How to

To...Do this
Set up a render node to export an extra plane
  1. Select the mantra render output node.

  2. In parameter editor, click the Properties tab, then click the Output sub-tab.

  3. Scroll down to the Extra image planes parameter and click the + button next to it to add a new plane.

    You can add as many extra planes as you need by increasing the Extra image planes parameter. See below for how to set up the plane’s parameters.

Output a global variable
  1. Set up an extra plane as shown above.

  2. Click the popup menu button on the right side of the VEX variable parameter and choose a global variable.

Output a shader variable
  1. For VOP networks, set up a Parameter node for the variable and set its Export parameter to Always. For VEX code, mark the variable as exported.

  2. Set up an extra plane as shown above.

  3. In the extra plane’s parameters on the mantra render node, set the VEX variable parameter to the name of the parameter you exported.

Output a variable per-light

Set Light Exports to Export variable for each light on the render node and it will create the proper per light outputs.

Note

If you only want one light, you can set Solo Light to the desired light in the Objects tab of the mantra output driver.

Parameters

Extra Image Planes

Any number of extra image planes may be generated simultaneously. If the primary output image format supports multiple image planes, the plane name will be used to define the name of the deep raster plane. If the primary output device does not support multiple image planes, each image plane will be output to an individual file, with the name of the plane defining the file name. The formats that support multiple image planes are OpenEXR and Houdini .pic (including the “ip” device).

Image Plane

The name of the plane.

VEX Variable

The VEX variable to be output to the image plane. The variable must be either a global variable, or an exported parameter.

When the N variable is output, its value may not be normalized resulting in either very small or very large values.

Note

Not all of the exports work with the surface model VOP and non-PBR renders. The following is the list of exports that will work with non-PBR renders: Cf, Of, Af, P, Pz, N, Render_Time, Op_Id, Prim_Id, direct_diffuse, direct_specular, direct_reflect, direct_refract, direct_volume, direct_emission, direct_noshadow, direct_shadow, indirect_reflect, indirect_refract, sss_single, sss_multi, direct_samples.

VEX Type

The correct type of the variable must also be specified.

Channel name

Name of the channel to write the variable data to in the output file (if the file format supports multiple named channels). Leave this field blank to use the VEX variable name as the channel name.

Different file

Turn on the checkbox next to this field to write the variable data to an output file other than the rendered image.

Note

You can specify the same “Different file” for multiple extra image planes with different channel names (if the file format supports multiple named channels).

Quantize

The storage type for the output.

Sample Filter
Opacity Filtering

Transparent surfaces will be composited using Of.

Closest Surface

Only the value of the closest surface will be output, regardless of the opacity of the surface.

Pixel Filter

Specifies the pixel filter used to combine sub-pixel samples to generate the value for the single pixel.

Gamma

Specifies the gamma correction for the image.

Gain

Each color value is multiplied by the gain prior to being quantized.

Dither

The dither amount to be applied. The dither is specified as a fraction of the quantization step (i.e. 0.5 will be one half of a quantization step). The option is ignored for floating point output.

White point

The white-point of the image used during quantization.

Export variable for each light

Creates a deep raster plane for all lights that match the criteria defined by the Light Mask and the Light Selection.

Light Mask

A list of light objects by name/bundle.

Light Selection

A list of light objects by category tags (see the Categories parameter on the light).

Note

For each light the deep raster plane name is prefixed with a mangled version of the path to the light. This can be specified manually by adding the rendering parameter Export Plane Prefix to the light sources. You can set the export prefix to an empty string on the output driver if you are generating deep rasters for a single light source in all cases. This will eliminate the prefix for all light sources.

Intrinsic Deep Rasters

The following are deep raster planes that you can specify to get additional intrinsic information.

Note

They are in the defaults menu for deep raster planes, along with the PBR planes.

Name Type

Description

Render_Time Float

Outputs the number of seconds spent rendering the tile as a floating point value.

Op_Id Float

Output the object identifier as a floating point value. This plane will store the value specified by the “object:id” object-level setting, or if this setting was not specified, it will store a unique identifier for the object covered by the pixel. Pixels with a value of -1 are not covered by any objects.

Prim_Id Float

Output the primitive identifier as a floating point value. This plane will store the geometry primitive number as can be queried in SOPs. Pixels with a value of -1 are not covered by any primitives.

Shading_Samples Float

Output the number of transparent samples shaded per pixel sample. This value is useful for debugging volume and sprite renders to determine how much processing time is spent shading transparent samples.

Opacity_Samples Float

Output the number of opacity samples shaded per pixel sample. This deep raster is only non-zero for renders using stochastic transparency, and is useful to debug the amount of processing time that is spend evaluating opacities before allocating shading samples. Using a larger volume step size in volume renders will decrease the number of opacity samples, improving performance.

PBR Deep Raster Exports

The default PBR shader supports a number of export variables. The table below shows the VEX variable name and type so that you can correctly configure deep raster outputs to reference these values.

Note

Exports available as a light export can be exported either on a per-light basis or as a combination for all lights. To specify a per-light value, supply the light name in the deep raster parameters. To specify a sum over all lights, leave the light name blank. The same variable name is used for both the light and combination export, though you should name the deep raster planes differently.

VEX Variable Name Type Light Export Available

Description

direct_diffuse vector yes

Direct lighting, diffuse component.

direct_glossy vector yes

Direct lighting, glossy component.

direct_specular vector yes

Direct lighting, specular component.

direct_caustic vector no

Direct caustics.

direct_emission vector no

Direct emission.

indirect_diffuse vector yes

Indirect lighting, diffuse component.

indirect_glossy vector yes

Indirect lighting, glossy component.

indirect_specular vector yes

Indirect lighting, specular component.

indirect_caustic vector no

Indirect caustics.

indirect_emission vector no

Indirect emission.

all_diffuse vector yes

All diffuse lighting.

all_glossy vector yes

All glossy lighting.

all_specular vector yes

All specular lighting.

all_caustic vector no

All caustic lighting.

all_emission vector no

All emission lighting.

direct vector yes

All direct lighting.

indirect vector yes

All indirect lighting.

level float no

Average pathtracing depth for a pixel.

diffuselevel float no

Average diffuse pathtracing depth for a pixel.

glossylevel float no

Average glossy pathtracing depth for a pixel.