Page tree

Versions Compared

Key

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

...

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

 

Below is a beauty render and the diffuse and specular reflection effects rendered alone in an LPE.

...

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

 

Scattering Events

...

Code Block
Diffuse (All types, direct and indirect): lpe:C<[RT]D>.*[<L.>O]
Specular (All types, direct and indirect): lpe:C<[RT]S>.*[<L.>O]

 

Direct and Indirect Light

...

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

 

...

 

Defining Events and Types

...

< > are used to choose/define a single event. For example, when deciding I want a specular reflection event, I can say <RS> for a reflective specular event. I cannot create an event that is either/or, meaning I can't say <RT> because that's two different types (reflection and transmission). Instead it must be a single type and event defined in the angle brackets. You can also put these in order to collect a light path in a specific order, such as <RS ><TD > as to say "one One reflective specular event and then a transmissive diffuse event next".

...

[ ] are used to define events of any/either/or. So in the example above I could say [RT] meaning one Reflection or Transmission type and [DS] which means Diffuse or Specular event. This is pretty common when you need to collect light along a path with many different possibilities. An example might be <[RT][DS]> which means a single event (note the angle brackets) with either a reflective or transmissive type (first set of square brackets) of a diffuse or specular event (the second set of square brackets).

...

Above we are explicitly stating what we want using the tokens. We can use shorthand and some following examples will use it. I can substitute a . (period) for the events and types.

Instead of writing out the tokens, just use a . for "whatever" if you need not be specific.

Code Block
Diffuse (All types, direct and indirect): lpe:C<.D>*[<L.>O]
Specular (All types, direct and indirect): lpe:C<.S>*[<L.>O]

You could even shorten the beauty AOV by saying:

Code Block
A longer beauty LPE can be seen as
Beauty: lpe:C<[RT][DS]>.*[<L.>O]
 
Can be written shorthand to a shorter version below
Beauty: lpe:C<..>*[LO]

This can be shrunk even further (you notice we remove a couple things where "any" or the . just gets omitted) but we'll go over what the LPE parser assumes later. For now we'll keep it tidy and readable.

 

...

 

Defining Bounces

Since we're tracing through the scene collecting light, it might be important to specify how much light you need or want to collect. This is usually meant to separate the direct and indirect events mentioned above. But you may also specify how many bounces along this path you want to collect rather than let the renderer collect all of them. Collecting specific bounces is covered later.

...

* means zero or more of these preceding events. Since it's zero or more, it will collect a direct lighting event and the ones that follow it (meaning indirect) til they reach a light source. It's the simplest way to capture light for the whole path. The following collects only diffuse reflection and all the events that match diffuse reflection until it strikes a light.

Code Block
lpe:C<RD>.*[<L.>O]


Plus

+ means one or more events. This means after the initial event, begin collecting others. This means it will collect indirect lighting only as the first (direct) event is skipped. Below is only indirect diffuse reflection (the typical indirect light AOV)

Code Block
lpe:C<RD>.+[<L.>O]


None

If none of the notations are used, it collects an event and then goes to the light, collecting only direct lighting. Below we omit the * and the +, only direct diffuse reflection is collected.

...

Let's look at an expanded beauty LPE. And by "expanded" I mean with all the parts spelled out and not in shorthand (which we'll cover later).

Code Block
lpe:C<[RT][DS]>*[<L.>O]