---
title: "Introduction to Light Path Expressions"
canonical: "https://documentation.chaos.com/space/VMAYA/111739610/Introduction%20to%20Light%20Path%20Expressions"
format: markdown
---
This page provides details about what the Light Path Expressions are.

 

## **Overview**

---

If you are not familiar with using Light Path Expressions (LPEs), this page is a good place to start. The sections below will try to explain what LPEs are, how they work and what are the possible use cases.

> ✅ The [Advanced Light Path Expressions article](https://docs-chaos.atlassian.net/wiki/spaces/VMAYA/pages/111739227) goes into greater detail about complex LPE usage and concepts.


## **What are LPEs?**

---

Light Path Expressions are a special type of render element with advanced capabilities. They use regular expression patterns to record selected events of light contribution along the path of a ray.

This can be used for very fine control in compositing by allowing you to tweak, for example, the GI coming from lights, the environment or self-illuminating objects separately, or each separate GI bounce, or the self-reflections of an object or the way SSS is seen behind refraction without re-rendering. The possible applications are practically endless.


## **Light Paths**

---


## **Ray Spawn Events and Scattering Types**

---

When a ray hits a surface, it can reflect, refract (transmit), or pass through a volume. These are the ray spawn events which we can record with LPE symbols.

We use the **R** symbol for reflection and **T** for refraction and sub-surface scattering.

They can be used directly, e.g. **R** captures reflections of any scattering type and is also equivalent to **<R.>**.


We can further specify the kind of hit we want to trace by combining R and T with one or more scattering types - diffuse (**D**), glossy (**G**), or singular (**S**). If we don’t specify that, all scattering types are assumed for our R or T events.

This allows us to filter the results only from diffuse reflection, for example with **<RD> **or combine glossy and singular reflection **<R[GS]> **.

 

By using ray spawn events and scattering types, we can recreate some familiar render elements or create custom single or multiple event expressions.

---