Page tree

Versions Compared

Key

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

...

Imagine a car headlamp rendered with the lights off. Using these mattes, one could extract the matte from the light from underneath the headlamp cover/lens and use a composting compositing package to "turn on" the light by using the mask to control glow and color and even animate this without re-rendering. Below we use a very simple example to show the results and some example Light Path Expressions to help you create your own. An example RIB file is included at the bottom of the page, please map your own HDRI to the Dome Light, the one used in the examples is the Griffith Observatory shipped in the Preset Browser assets. The scene has a pane of glass (with thickness) and a mirror.

...

Typically when extracting masks/mattes, you see the mattes for anything visible directly to the camera like the Cryptomatte specification. In this case I have matte colors assigned to the green and yellow balls and the pane of glass in the scene. I have chosen the typical RGB colors and assigned them to the User Color in the global parameters of PxrSurface. You can also drive these with object attributes for a procedural workflow. You would get this result by default and is most common, it is also the result using the bridge product's default LPE preset for User Color: 

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.

...

Let's start with the preset or usual defaults. You would get this result by default and is most common, it is also the result using the bridge product's default LPE preset for User Color in something like RenderMan for Maya:

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

...

Using regular LPE syntax this result is basically correct, even the double reflections, but in the beauty image this secondary reflection isn't visible because of the HDRI, the balls just aren't bright enough. (However, the equivalent LPE of the mirror reflection will indeed show this secondary ball reflection not visible in the beauty.) This is not intuitive at first because you'd expect a similar response to what is seen in the beauty. But User Lobes are not energy conserving material responses, instead they are data. So we can remove this extra reflection easily by changing the LPE slightly:

...

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


Advanced Thoughts

...