Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: wikit macro-replace (build 4280ad5-2021.10.08.115947) run by cwalker

...

Info

Hand-authoring LPE can be a tedious process and for artists it's not always desired to do these manually. This document aims to improve the artist's understanding and usage of LPE.

Understanding these concepts and applying them will make you a hero to many pipelines given the power and flexibility of the feature.

Table of Contents

In production it often becomes necessary to create non-physical effects and art-directed changes to your shot. Light Path Expressions (LPE) are a powerful way to collect and output specific light paths for alteration later.

...

Info

An excellent primer with useful visuals can be found in a tutorial video from Lollipop Shaders. Begin at Class 6 for the LPE introduction.

...

Carousel Image Slider
stretchfalse
dotsfalse
infinitefalse
sliderHeight300
arrowsfalse
labelsFilterlperefl
gutterSize2
slidesToScroll01
captionstrue


Code Block
Diffuse Reflection: lpe:C<RD>*[<L.>O]
Specular Reflection: lpe:C<RS>*[<L.>O]

...

Carousel Image Slider
stretchfalse
dotsfalse
infinitefalse
sliderHeight300
arrowsfalse
labelsFilterlpetrans
gutterSize2
slidesToScroll01
captionstrue

Code Block
Diffuse Transmission: lpe:C<TD>*[<L.>O]
Specular Transmission: lpe:C<TS>*[<L.>O]

...

Carousel Image Slider
stretchfalse
dotsfalse
infinitefalse
sliderHeight300
arrowsfalse
labelsFilterlpediff
gutterSize2
slidesToScroll01
captionstrue

A specular scene using iridescence and transmission (glass).

Carousel Image Slider
stretchfalse
dotsfalse
infinitefalse
sliderHeight300
arrowsfalse
labelsFilterlpespec
gutterSize2
slidesToScroll01
captionstrue

 

Now that we have some understanding of the main components, let's begin by looking at the parts used to organize an LPE

...

Carousel Image Slider
stretchfalse
dotsfalse
infinitefalse
sliderHeight300
arrowsfalse
labelsFilterlpebounce
gutterSize2
slidesToScroll01
captionstrue

The curly brackets can also take a range of values to render a set of bounces. Maybe you're only interested in collecting the effects of the 4th through 8th bounce? Or maybe you know where to begin or end but want the renderer to decide where that is.

...

Carousel Image Slider
stretchfalse
dotsfalse
infinitefalse
sliderHeight300
arrowsfalse
labelsFilterlpespefbounce
gutterSize2
slidesToScroll01
captionstrue

 

The Beauty Render

...

So we're rendering the same cube but this time the light path has to exclusively include all the light bouncing off of and through the rightWall object. So our result is a very green object since we captured just the green wall's bounce light. You can see now how to separate light paths to get what you need to adjust for later compositing. I'm rendering the tall rectangle and all the light that lands on it after leaving the green wall.


Of course I can also exclude just the green wall. Maybe the green wall is generating noise, I can avoid those light paths by using the caret and a simple tweak of my LPE

Code Block
lpe:C<[RT][DS]'scatterCube'>+<[RT][DS][^'rightWall']>[<L.>O]


Shorthand
lpe:C<..'scatterCube'>+<..[^'rightWall']>[<L.>O]

Image AddedImage Added


The Importance of Naming

Naming your channels is important not just for pipeline reasons and readability, but because the Denoiser utility requires that you follow a naming convention in order to be denoised. Since the tool isn't psychic, it needs a hint as to what is inside the framebuffer/AOV and it uses the name to decide this. There are two main ways the Denoiser filters results, and the way triggered by a "diffuse" keyword is that the albedo is divided out before denoising happens, this is done to prevent texture smearing. So when naming your AOVs, keep that in mind knowing that you'll most likely want your results to be denoised. Below are the acceptable prefixes given again.

...