Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

PxrSurface has two added data user lobes. One is used to output World Position (U3) and another can be used to specify a color or pattern for output (U4). Neither of these lobes are rendered to the beauty and rely on the user to specify a Display Channel (AOV) for output. The bulk of this document will cover the use of the U4 lobe for color or patterns, but the LPE given can substitute U3 to get the World Position of the object.

The typical usage scenario is output for post operation and compositing. This data can be extracted from indirect effects. This makes it possible to write an AOV with a matte for an object in a reflection or transmission (refraction). This adds flexibility without having to render in layers. The equivalent would be RGB Mattes or a "Clown Pass", so-called because of the primary colors used.

...

Info

For data passes we make use of LPE modifiers, nothruput;noinfinitecheck;noclamp;unoccluded; you can find these at the bottom of the LPE page, for the purposes of this document you should pay most attention to the part of the LPE that begins with the camera (C) as it is used to define the path collected. The rest is included for completeness.

  • unoccluded – returns unoccluded or unshadowed result. If not included, your result will include shadowing and may not be useful as a matte as the shape of the object and shadowing will be evident
  • noclamp – returns unclamped result.
  • nothruput – does not apply thruput (thruput is the accumulative albedo of the objects hit by rays). If omitted, the masks will be attenuated. For example, a color of 1,0,0 is pure red but may be 0.5,0,0 after a reflection or refraction, the actual result is based on the light path and material response(s)
  • overwrite – instead of outputting the accumulated result, overwrite it. One example of using this is for the albedo output where we do not want an accumulated result. If left out your result may contain values different than expected. In this example the color 1,0,0 may return 6,0,0 etc. and bleed onto neighboring pixels
  • noinfinitecheck – do not do any infinite check.


User Color

Let's start with the preset defaults.

Code Block
lpe:nothruput;noinfinitecheck;noclamp;unoccluded;overwrite;CU4L

...

Using the same LPE I can also connect a pattern to the User Color like PxrVoronoise or even a texture:

World Position

The default LPE for the Position pass results in this render, note that Position is enabled for anything with PxrSurface assigned.

Code Block
lpe:nothruput;noinfinitecheck;noclamp;unoccluded;overwrite;CU3L


Image Added

Using the same LPE as above you can begin to refine these results as well, for example the green ball in the mirror.

Code Block
lpe:nothruput;noinfinitecheck;noclamp;unoccluded;overwrite;C<RS><.U4'greenBall'>[LO]


Image Added

Advanced Thoughts

Since you can use the functions of LPE, you can do some advanced things like selecting the specific bounce of light for an object as well as the object where it's visible (reflected or transmitted).

Image Added

The default preset gives you this result:


Image Added


By changing this to indirect reflections we get all the spheres:

Code Block
lpe:nothruput;noinfinitecheck;noclamp;unoccluded;overwrite;C<RS>+<.U4>[LO]


Image Added


Or we can specify just the 3 bounce giving us a specific set of reflected spheres.

Code Block
lpe:nothruput;noinfinitecheck;noclamp;unoccluded;overwrite;C[<RS><.U4>]{3}[LO]


Image Added