Documentation



Menu

Light Path Expressions

Light Path Expressions (LPEs) describe the propagation of light through a scene starting from a source of light, bouncing around between objects in the scene and ultimately ending up at the eye. LPEs allow you to filter the results of an Iray+ render and to 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 (for example, 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 enabled Render Elements.

Using Light Path Expressions

  1. Open Rendering > Render Setup… and select the Render Elements tab.
  2. On the Light Path Expressions rollout, tick the Enable LPEs checkbox:
  3. The Iray for 3ds Max Render Elements tab - LPEs

To add an LPE to the Render Elements:

  1. At the bottom of the Light Path Expressions rollout, click New.
  2. In the New LPE dialog, choose either an Alpha or RGB Buffer, enter a Name for your LPE, then add the LPE itself.
  3. Adding an LPE
  4. Click OK to create and add the LPE to the table in the rollout, or Cancel to discard it.
✱  Note: the LPE name is a label for your own convenience. An LPE can be named anything (for example, "Diffuse Layer", "My LPE"). This label will be appended to the filename saved out in Production Rendering Mode. For example, if you are rendering your scene out to My_Render.png and you add an LPE named "My_LPE", then you will also get My_Render - My_LPE.png.

To edit or rename an LPE that you have already added to the Render Elements:

  1. Select the LPE from the table in the Light Path Expressions rollout.
  2. At the bottom of the rollout, click Edit.
  3. Make any required changes.
  4. Editing an LPE
  5. Click OK to apply your edits or Cancel to discard them.

To delete an LPE that you have already added to the Render Elements:

  1. Select the LPE from the table in the Light Path Expressions rollout.
  2. At the bottom of the rollout, click Delete.

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 or refraction through glass) 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:

E.*L

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 (for example, begin with E D or end with D E) will yield results when performing Lighting Analysis.

More resources



See Also:

Last edited: