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 will capture contributions of the light that is added to the Light Select set. If the Light Select is empty, the expression will extract contributions from all scene lights. LPEs also allow extracting information from the environment, for example allow capturing the GI that comes from the environment only. We’ve added a list of the basic symbols for constructing a Light Path expression. Тhere is a dedicated LPE Builder available to help you compose expressions and track exactly which ray paths they capture. |
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.). 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. |
Finally, there's 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. |