Rollover image for specular LPE AOV
Light Path Expressions (LPEs) are useful for outputting light into specific AOVs. LPEs describe the transport of light through the scene, starting from a source of light, bouncing between objects and finally ending up at the camera. LPEs can be used to extract specific light contributions from Arnold into separate built-in or custom AOVs which can be output and recombined in various ways in a compositing package.
It is recommended that you familiarize yourself with 'Light Path Expression AOVs' first. A full list is available here.
|The final scene can be found on the Learning Scenes page.|
Built-in LPE AOVs
LPEs are not particularly artist friendly, and so a list of built-in LPE AOVs are provided in Arnold. Below are some examples of the built-in light path expression AOVs that have been used in this scene.
LPE (diffuse) 'CD<RD.*' viewed in Arnold IPR Window
The built-in AOVs are suitable for most tasks. However, custom AOVs can give more control when using LPEs. For example, you can choose combinations of LPEs to use when rendering the scene.
In the example below
C[ST].*[LO] renders Specular and Transmission [ST]. Diffuse (
D) has not been used in this case, and therefore the background is not rendered as it only has a diffuse component.
Below are some further examples of LPEs used with Custom AOVs.
Light Groups and LPEs
It is also possible to output per light AOVs. Combining light groups with LPEs can be a powerful tool when compositing AOVs. By default, LPEs use all of the lights in the scene. We can limit the light contribution from single or multiple lights using light groups.
- In this case, we have used the following AOV Light Group names for each light: key light (white), rim light1 (magenta) and rim light2 (blue).
- We will add a custom AOV, for example, an "
RGBA_" prefix. The light group name for the blue rim light would therefore be "
RGBA has been used in this example, but you can use any other LPE.
- Now we can use the <L.'groupname'> syntax to isolate the specular reflection contribution from the blue light using the following expression:
For light group AOVs, using
<L.> is required instead of just
Specular reflection from blue rim light: C<RS><L.'blue'>.*
Custom AOV with LPE added in its Attributes
We can restrict expressions to specific shader parameters. In the example below,
C<RS[^'coat']>.* has been used to render the scene without coating. The helmet shader is therefore not apparent in the rendered image when Coat is at 1. However, specular (RS) is visible in the helmet when Coat is below 1.
Helmet is invisible when its Coat value is 1 (rollover image for specular only)