Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section
Column
width45%

Light Path Expressions, or LPEs are a very powerful and advanced tool for extracting specific lighting events from the scene to a separate channel. This allows for a very fine control of the image in compositing.

For example, LPEs allow breaking the GI down to different types of light sources like lights, the environment, and self-illuminating objects, or breaking down the GI to its separate bounces, or capturing only self-reflections, or the SSS that's only seen behind glass and similar for compositing control of only this aspect of the image.

UI Text Box
typetip

Read our Introduction to Light Path Expressions article.

The right-click menu offers a list of all symbols in LPEs, as well as presets to get you started.

There are preset equivalents to already available render elements (like Beauty, Lighting, GI, Light Select types, etc). There are also Misc and masking presets for the GI coming from the environment or for the GI coming from a specific object.

UI Text Box
typenote

Light Path Expressions that capture specific events after the second GI bounce will work correctly only with Brute Force as a secondary GI engine

Also available is a list of boolean operations that allow more complex expressions to be rendered in a single channel. For example, in this way, some compositing operations like union or subtraction can be done in the renderer instead of in the compositing application.

UI Text Box
typetip

Тhere is a dedicated LPE Builder available to help you compose expressions and track exactly which ray paths they capture.

Column
width10%

Column
width33%
Image Removedc4d2024_61030_LightSelect_parameters.pngImage Added 



Scene Setup

...

The scene setup is similar to the Light Select workflow. As LPEs are a mode of the Light Select render element, the expression captures contributions of the light(s) added to the Light Select set. If the Light Select is empty, the expression captures contributions for all scene lights.

...

Ray spawn events other than C or V can be combined with scattering types (e.g. <RD> - capture only diffuse reflection) to get a more specific ray event, or they can be used directly (e.g. R - capture reflections of any scattering type. This is also equivalent to <R.>)

Ray termination events can also be combined with each other when you want to capture the contribution of a light together with emissive objects, e.g., C<RD>.*[LO] will capture the GI coming from lights or emissive objects.

See a full list of LPE Symbols:

UI Expand
titleLPE Symbols
Section
Column
width60%

Symbol

Description

Type

Initial ray spawn event

C

Camera ray

Initial ray spawn event

Ray spawn events

R

Reflection ray

Ray spawn event

T

Transmission ray

Ray spawn event

V

Volume ray

Ray spawn event

Scattering types

D

Diffuse scattering

Scattering type

G

Glossy scattering

Scattering type

S

Singular scattering

Scattering type

s

Straight (no) scattering

Scattering type

Ray termination (final) events

L

Light hit

Ray intersection event

O

Emitting object hit

Ray intersection event

B

Background hit

Ray intersection event

Logical operators

|

OR

Logical operator

.

Any/ All

Logical operator

?

Optional

Logical operator

*

0 or more repetitions

Logical operator

+

1 or more repetitions

Logical operator

()

Group symbols

Logical operator

[]

Group events/ scatterings/ labels

Logical operator

[^]

Invert events/ scatterings/ labels

Logical operator

<>

Group events, scatterings, and labels together

Logical operator

' '

Label

Logical operator

 

Column
width5%

Column
width35%

Image Removedc4d2024_61030_LightSelect_Basic_symbols.pngImage Added




Presets

...

A number of presets are available for Light Path Expressions.

...

UI Expand
titleLPE Presets: Render Element equivalents
Section
Column
width60%

Preset

Light path expression

Render elements
RGBC.*
Self-illuminationC[OL]
BackgroundCB
LightingC<RD>L
SpecularC<R[GS]>L
GIC<RD>(.+L|.*[OB])
SSSC<TD>(.+L|.*([OB])
ReflectionC<R[GS]>(.+L
RefractionC<T[GS]>.+L
AtmosphereCV.*
UI Text Box
typetip
It is faster and more efficient to use the already available render elements instead of their LPE equivalents in the presets, of course - the examples are there as a point of reference.
Column
width5%


Column
width35%

Image Removedc4d2024_61030_LightSelect_REs.pngImage Added

UI Expand
titleLPE Presets: Light Select equivalents
Section
Column
width60%

Preset

Light path expression
Light selects
Direct IlluminationCRL
Direct DiffuseC<RD>L
Direct SpecularC<R[GS]>L
FullC.*L
IndirectCR.+L
Indirect DiffuseC<RD>.+L
Indirect SpecularC<R[GS]>.+L
Column
width5%


Column
width35%

Image Removedc4d2024_61030_LightSelect_LightSelects.pngImage Added

UI Expand
titleLPE Presets: Misc




Section
Column
width60%

Preset

Light path expression
Misc

Self-illumination, no lights

CO
GI from self-illuminationC<RD>.*O
GI from environmentC<RD>.*B
Column
width5%


Column
width35%

Image Removedc4d2024_61030_LightSelect_Misc.pngImage Added



UI Expand
titleLPE Presets: Object/Material select



Section
Column
width60%

Preset

Light path expression
Object/Material select

Indirect for object label 1

CR'1'.+L
Indirect for all object labels but 1 and 2CR[^'1''2'].+L
RGB for material label 1C.'m1'.*
Column
width5%


Column
width35%

Image Removedc4d2024_61030_LightSelect_ObjectSelect.pngImage Added

Boolean operations

...

UI Expand
titleBoolean operation symbols
Section
Column
width60%

Boolean operation

Symbol
Operations between expressions

Complement

^
Intersection&&
Union

|

Subtraction-
Column
width5%

Column
width35%

Image Removedc4d2024_61030_LightSelect_Boolean.pngImage Added