Light Path Expressions

Light Path Expressions (LPEs) describe the propagation of light through a scene starting from a source of light, bouncing around between the objects of the scene and ultimately ending up at the eye. LPEs allow you to filter the results of an Iray+ render and display a subset of the light contributions in your scene. For example, showing only the contributions from certain light sources, only glossy reflections, or only the interactions involving a particular piece of geometry.

The results of a render can be split into multiple canvases at the same time, with minimum additional overhead, allowing flexibility for compositing or manipulating the image in post-production (e.g, recoloring or scaling the contributions from individual light sources, changing the color of specific materials, or intensifying specular highlights).

The separate Render Elements functionality has less flexibility to create layers of information but may often give the required result. Some types of information, useful for post-processing, are only available using Render Elements, for example, Material ID. LPEs will be rendered out at the same time as any Render Elements defined.

Using Light Path Expressions

  1. Open Render Setup > Render Elements
  2. Toggle on/off the checkbox for Enable LPEs.
  3. At the bottom of the Light Path Expressions rollout select New.
  4. In the New LPE dialog, choose between an Alpha or RGB Buffer, enter a Name and your light path expression (LPE) and select OK. The LPE will appear in the table above. Choose Cancel to abort entry.
  5. ✱  Note:
    The LPE name is a label for your own convenience, they can be named anything (e.g. "Diffuse Layer", "My LPE" etc). This label will be appended to the filename when you save out a Production Render. For example, if you are rendering your scene out to My_Render.png and add an LPE called "My_LPE" you will also get My_Render - My_LPE.png.

To edit or rename an LPE that you have already added to the render elements, follow these steps:
  1. Select in the table the LPE you wish to edit
  2. Select Edit and make any changes to the name or LPE
  3. Click OK to accept the changes or Cancel to abort.

To delete an LPE that you have already added to the render elements, follow these steps:

  1. Select in the table the LPE you wish to delete
  2. Click the Delete button.

LPE Basics

LPEs are constructed with regular expressions that describe a particular light transport path, or set of paths, as light propagates through a scene. They can contain any number of specific interactions between the light source and the camera and can become quite complex. The LPE grammar is very powerful and flexible, but as a result it can be difficult to know where to begin.

Light transport paths begin at a light source and end at the eye. The most basic LPE is the one that captures all light transport paths (i.e., the same as a standard "Beauty" render):

L .* E

The L operator denotes all light sources in the scene, so if your scene contains multiple light sources (lights, IBL, physical sky etc), this will capture contributions that begin at any of them. The . operator means "any interaction" (such as mirror bounces, refraction through glass etc) and is essentially a wildcard. The * operator means "any number of the previous interaction", so .* means "any number of any type of interaction". The final E operator denotes the eye (i.e., camera) and is used to mark the end of the light transport path. So this LPE will capture rays that originate from any light source in the scene, and then undergo any number of any type of interaction before reaching the eye. In other words, it captures all light transport paths.

When writing LPEs, you can add spaces for clarity, however they are optional and not required by the syntax. If you prefer, you can also define LPEs by starting at the eye and ending at a light source, so the following LPE is exactly equivalent to the first:


LPE Examples

LPE Description Notes
L.{2,}E Indirect Lighting Displays all light that has bounced more than once
E.*Le Environment Lighting Displays all light contributed by the environment
E.*La Area Lighting Displays all light contributed by Area Lights
E<RS.>.*L Specular Reflection Displays all specular reflection that hits the camera

✱  Note:
Only LPEs that capture a diffuse event immediately before the eye/camera event (e.g., begin with E D or end with D E) will yield results when performing Lighting Analysis.

More Resources

See Also:

Page Last Edited: