Light Path Expression AOVs

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.

Builtin LPEs

The following light path expression AOVs are built-in.

NameExpression 
RGBA
C.*
Beauty AOV with all light paths
direct
C[DSV]L
Direct light from all surfaces and volumes
indirect
C[DSV][DSVOB].*
Indirect light from all surfaces and volumes
emission
C[LO]
Lights and emissive objects directly visible from the camera
background
CB 
Background emission
diffuse
C<RD>.*
Diffuse reflection
specular
C<RS[^'coat']>.*
Specular reflection
coat
C<RS'coat'>.*
Coat reflection
transmission
C<TS>.*
Specular transmission
sss
C<TD>.*
Subsurface scattering and diffuse transmission
volume
CV.*
Volume scattering
albedo
C[DSV]A
Albedo (reflectivity)
   
diffuse_direct
C<RD>L
Diffuse direct light
diffuse_indirect
C<RD>[DSVOB].*
Diffuse indirect light
diffuse_albedo
C<RD>A
Diffuse albedo
specular_direct
C<RS[^'coat']>L
Specular direct light
specular_indirect
C<RS[^'coat']>[DSVOB].*
Specular indirect light
specular_albedo
C<RS[^'coat']>A
Specular albedo
coat_direct
C<RS'coat'>L
Coat direct light
coat_indirect
C<RS'coat'>[DSVOB].*
Coat indirect light
coat_albedo
C<RS'coat'>A
Coat albedo
transmission_direct
C<TS>L
Transmitted / refracted direct light
transmission_indirect
C<TS>[DSVOB].*
Transmitted / refracted indirect light
transmission_albedo
C<TS>A
Transmission albedo
sss_direct
C<TD>L
SSS and diffuse transmission direct light
sss_indirect
C<TD>[DSVOB].*
SSS and diffuse transmission indirect light
sss_albedo
C<TD>A
SSS and diffuse transmission albedo
volume_direct
CVL
Volume direct light
volume_indirect
CV[DSVOB].*
Volume indirect light
volume_albedo
CVA
Volume albedo

Composing the Beauty AOV

The 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 by diffuse_albedo, or for denoising just the lighting while keeping the texture detail intact.

RGBAdirect + indirect + emission + background
RGBAdiffuse + specular + sss + volume + emission + background

Syntax

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.

Events

Symbol 
CCamera
LLight emission from all lights
<L.'groupname'>Light emission from light in AOV groupname
<L.'default'>Light emission from lights with no AOV group assigned
OSurface or volume object emission
BBackground emission
AAlbedo

Scattering Events

Symbol 
DDiffuse reflection, transmission or subsurface scattering
<RD>Diffuse reflection
<TD>Diffuse transmission or subsurface scattering
SSpecular reflection or refraction
<RS>Specular reflection
<TS>Specular refraction
VVolume scattering

Operators

Expression 
ABA followed by B
[ABC]A, B or C
((AB)|(CD))AB or CD
[^A]Any event except A
A*0 or more A events
A+1 or more A events
.Any event
'myevent'Custom event

Custom Expressions

Custom light path expressions are added to options.light_path_expressions, and can then be used as AOVs in options.outputs.

Custom expressions can override built-in expressions with the same name, if a different behavior is desired.

Light Groups

Besides the <L.'groupname'> syntax, any builtin 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 options.outputs.

Custom Labels

BSDF lobes, BSSRDFs and emission closures may be tagged with a custom label to output them to separate AOVs.

For builtin shaders standard hair is labeled with 'hair', and the standard surface coat is labeled with 'coat'. All other builtin shaders components have no labels. So the following expressions could be used for example:

Custom shaders could for example label BSSRDFs and emission, and then use expressions like these:

  • No labels