For Arnold 5.0 shaders using closures, light path expressions are used to output light into specific AOVs. Rather than writing to specific AOVs from shaders, LPEs can be used to extract specific light paths using regular expressions.
There is also an Introduction to Light Path Expressions tutorial.
The following light path expression AOVs are built-in.
|Beauty AOV with all light paths|
|Direct light from all surfaces and volumes|
|Indirect light from all surfaces and volumes|
|Lights and emissive objects directly visible from the camera|
|Subsurface scattering and diffuse transmission|
|Diffuse direct light|
|Diffuse indirect light|
|Specular direct light|
|Specular indirect light|
|Coat direct light|
|Coat indirect light|
|Transmitted/refracted direct light|
|Transmitted/refracted indirect light|
|SSS and diffuse transmission direct light|
|SSS and diffuse transmission indirect light|
|SSS and diffuse transmission albedo|
|Volume direct light|
|Volume indirect light|
RGBA beauty AOV can be split into smaller AOVs where each contains part of the lighting. In compositing, these AOVs can then be individually modified and added together to get the full beauty AOV.
More AOVs give more control in compositing, but also extra work to handle, and they take up more memory and disk space, especially combined with light groups. Some example sets of additive AOVs for the full beauty AOV are:
direct, indirect, emission, background
diffuse, specular, coat, transmission, sss, volume, emission, background
diffuse_direct, diffuse_indirect, specular_direct, specular_indirect, coat, transmission, sss, volume, emission, background
Simply adding together such AOVs is all that is needed for the beauty AOV. The albedo AOVs are not needed to reconstruct the beauty AOV but may be used for example to get just the lighting without the surface texture, by dividing
diffuse_albedo, or for denoising just the lighting while keeping the texture detail intact.
|RGBA||direct + indirect + emission + background|
|RGBA||diffuse + specular + sss + volume + emission + background|
All expressions must start with a camera event
C. After that, there can be zero or more scattering events, until a light, object or background is hit. The syntax is similar to regular expressions. The following events and operators are supported.
|Light emission from all lights|
|Light emission from light in AOV |
|Light emission from lights with no AOV group assigned|
|Surface or volume object emission|
|Diffuse reflection, transmission or subsurface scattering|
|Diffuse transmission or subsurface scattering|
|Specular reflection or refraction|
|A followed by B|
|A, B, or C|
|AB or CD|
|[^A]||Any event except A|
|0 or more A events|
|1 or more A events|
Custom light path expressions are added to
options.light_path_expressions, and can then be used as AOVs in
Custom expressions can override built-in expressions with the same name if different behavior is desired.
light_path_expressions 2 1 STRING "caustics CDS.*" "diffuse_albedo CDA" outputs 3 1 STRING "RGBA RGBA filter driver" "caustics RGB filter driver" "diffuse_albedo RGB filter driver"
<L.'groupname'> syntax, any built-in or custom LPE can be split into multiple AOVs to output a subset of lights with a specific AOV group assigned in the
light.aov parameter. For this, a postfix must be added to the LPE AOV name in
outputs "diffuse RGB filter driver" # all lights in one AOV outputs "diffuse_* RGB filter driver" # output multiple AOVs, one for each light group outputs "diffuse_groupname RGB filter driver" # only light in AOV group "groupname" outputs "diffuse_default RGB filter driver" # only lights with no AOV group assigned
BSDF lobes, BSSRDFs, and emission closures may be tagged with a custom label to output them to separate AOVs.
For built-in shaders standard hair is labeled with 'hair', and the standard surface coat is labeled with 'coat'. All other built-in shaders components have no labels. So the following expressions could be used for example:
light_path_expressions 2 1 STRING "hair C'hair'.*" "specular_except_coat C<RS[^'coat']>.*"
Custom shaders could for example label BSSRDFs and emission, and then use expressions like these:
light_path_expressions 2 1 STRING "sss_skin C<TD'skin'>.*" "emission_fire C<O.'fire'>"