Shadow/Reflection Collector

Shadow/Reflection Collector

  • Note

    The Katana scene file for this example - shadowAndReflectionCatcher.katana - is included in $KATANA_RESOURCES/Examples/katana_files/.

Description

The shadow and reflection collectors are AOVs via Light Path Expressions.

The shadow collector LPE (lpe.shadowcollector) gathers the amount of occlusion/shadow for direct lighting only and at camera hits only. Note that it is possible to write a custom LPE that would include shadows for non-direct lighting.

The reflection collector LPE (lpe.reflectioncollector) captures all indirect specular reflections, for any number of bounces. It will not include any direct illumination (only indirect illumination from specular reflections).

How To Render Alpha AOV

Using PxrMatteID

In order to use the shadow and reflection AOVs in the comp, we need an alpha AOV for the objects that cast the shadow and reflection onto the receiving object (e.g. the ground plane). In PRMan 19, the PxrMatteID pattern, along with MatteID AOVs, can be used to generate the objects' alpha.

Unlike the traditional alpha channel (Oi) available in previous versions of PRMan, using the PxrMatteID pattern is more flexible and allows assigning different colors to different objects in the scene. It is then possible to use compositing software to extract an alpha channel for one or more groups of objects in the scene using the AOV generated by the PxrMatteID pattern. The MatteID AOV also matches the motion blur accurately.

Since PxrMatteID has to be connected to each bxdf shader that contributes to MatteID, it is recommended to plan ahead of time to simplify your workflow for generating the alpha AOVs. If you only need to use it as an alpha for shadow collector, it may be simpler to create a separate render pass where there are only a few shaders (with your original displacement shader connected) with a few MatteID AOVs. A lot of AOVs makes it harder to manage.

Setting Up MatteID AOV

  • For the object that we need to create a MatteID AOV, we need to add the MatteID attribute to that object:
images/rfkMatteID0Attribute.png
  • For the display channel of the AOV, create a PrmanOutputChannelDefine node.
images/rfkMatteID0ChannelDefine.png
  • For the output file of the AOV, create a RenderOutputDefine.
images/rfkMatteID0OutputDefine.png
  • Wire PrmanOutputChannelDefine into RenderOutputDefine to see the channel in the RenderOutputDefine's channel drop down.
images/rfkAOVChannelDefines.png

How To Create A Shadow/Reflection Collector in Katana

  • Create a PrmanObjectSettings node. Add the object you want to collect shadows or reflections, e.g. the ground plane. In the ribInclude, enter the lpegroup collector attribute.
images/rfkLPEGroupCollector.png
  • For the display channel of the shadowcollector AOV, create a PrmanOutputChannelDefine node.
images/rfkShadowCollectorChannelDefine.png
  • For the display channel of the reflectioncollector AOV, create a PrmanOutputChannelDefine node.
images/rfkReflectionCollectorChannelDefine.png
  • For the output file of the shadowcollector AOV, create a RenderOutputDefine.
images/rfkShadowCollectorOutputDefine.png
  • For the output file of the reflectioncollector AOV, create a RenderOutputDefine.
images/rfkReflectionCollectorOutputDefine.png
  • Connect the above nodes to the RenderSettings/Render node.
  • Render!

Nuke Script

The script - rmsTeapots_ShadowReflectionComp.nk - and images are included in the compExample directory of the tutorials bundle.