Skip to content
07-848 2005

V-Ray for Blender

Light Path Expressions

This page provides information about Light Path Expressions.

Last updated 18 September 2025

This page provides information about Light Path Expressions.

Overview

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 capturing only self-reflections, or the 1st bounce of GI, or the SSS that's only seen behind glass and similar for compositing control of only this aspect of the image.

The LPE syntax is based on regular expressions. Expressions describe a light path that starts from the camera and bounces around the scene until it reaches a light source.

The scene setup is similar to the Light Select workflow, as LPEs are a mode of the Light Select. The expression captures the contributions of the light that is added to the Light Select set. If the Light Select is empty, the expression extracts contributions from all scene lights. LPEs also allow extracting information from the environment, for example, capturing the GI that comes from the environment only.

Additionally, you can see what expression should get you the equivalent of some of the already available render elements (like Beauty, Lighting, GI, Light Select types etc.).

Finally, there are some Misc and masking LPE examples, e.g. to capture the GI coming from the environment or to get the GI coming from a given light bounced off of a given object marked by an extra attribute.

LPE Symbols

The LPE alphabet consists of the symbols representing a ray event/type and additional regular expression symbols (“.”, “+”, “*”, “<”, “>”, “[“, “]”, “|”, “?”, “^” and additional label strings).

A valid expression needs to start from the camera (C), capture ray spawn or scattering events, and end at light (L), an emissive object (O), or the environment (B).

Ray spawn events other than C 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.

Symbols:

Initial ray spawn event

C – Camera ray; Not final.

Ray spawn events

R – Reflection ray; Not final.

Т – Transmission ray; Not final.

V – Volume ray; Not final.

Scattering types

D – Diffuse scattering; Not final.

G – Glossy scattering; Not final.

S – Singular scattering; Not final.

s (lowercase) – Straight (no) scattering; Not final.

Ray termination events

L – Light hit; Final.

O – Emitting object hit; Final

B – Background hit; Final

Render Elements

This section lists the light path expression that correspond to some render elements.

RGB RE = C.*

Self-illumination RE = C[OL]

Background RE = CB

Lighting RE = C<RD>L

Specular RE = C<R[GS]>L

GI RE = C<RD>(.+L|.*[OB])

SSS RE = C<TD>.+L

Reflection RE = C<R[GS]>.+L

Refraction RE = C<T[GS]>.+L

Atmosphere RE = CV.*

Light Select

This section lists the light expressions that correspond to some light selects.

Direct Illumination = CRL

Direct Diffuse = C<RD>L

Full = C.*L

Indirect = CR.+L

Indirect Diffuse = C<RD>.+L

Indirect Specular = C<R[GS]>.+L

Misc

This section lists light path expressions that correspond to miscellaneous lights

Self-illumination, no lights = CO

GI from self-illumination = C<RD>.*O

GI from environment = C<RD>.*B

Object/Material select

This section lists light path expressions that correspond to object or material selections.

Indirect for the object label "obj1" = CR'obj1'.+L

Indirect for all object labels but "obj1" and "obj2" = CR[^'obj1''obj2'].+L

RGB for material "Material #01" = C.'mMaterial #01'.*