User:Bnrayner/sandbox
A Light Path Expression (LPE) is a regular expression notation used in 3D computer graphics to describe the light transport and scattering events that take place as light travels from a light emitter to a light sensor.
Light path regular expressions were first introduced by Paul Heckbert in 1990 as a generic means for describing the light paths generated by different sampling strategies such as ray tracing and photon mapping. Eric Veach formalized this notation in 1997 to aid in the description of complex light transport mechanisms such as bidirectional path tracing and Metropolis light transport.
Functionally, LPEs can be used to declare output images for digital compositing. This allows artists to more easily create visually pleasing or non-physical effects. Light Path Expressions are similar to Arbitrary Output Variables (AOVs) in that they separate the primary render into individual framebuffers, however AOV separation tends to be handled locally by the material shader while LPE separation is handled globally by the rendering engine. LPEs are also restricted to describing physical light paths while AOVs can output arbitrary data such as surface normals or intersection depth.
LPE notation is goverend by an abbreviated event syntax that closely corresponds with 3D computer graphics terminology.
Events
[edit]Light transport can be represented by combining emission, scattering, and sensing events. Emission and sensing are treated special because a single light path must contain exactly one of each; all relevant paths start with light emission and end with a light sensor. A single light path can contain zero or more scattering events.
Each scattering event can be described as <t m h>
where t
is the scattering type, m
is the event mode and h
is a scene handle. The scattering type indicates whether light is reflected or transmitted by a surface, or if the interaction was volumetric. Event modes characterize each BSDF interaction as being either diffuse, glossy, or specular. Scene handles allow light paths to be tied to a particular scene entity.
Lights emission events can be described as <e h m h>
where e
is the emission event and m
and h
are the same as before. Light sensors do not have a mode or handle and can simply be described as <s>
.
A light path can thus be described as a chain of scattering events sandwiched between an emission and sensing event, e.g.
<e h m h> <s>
<e h m h> <t m h> <s>
<e h m h> <t m h> ... <t m h> <s>
It is equally valid to describe light path as bouncing in either a forwards (lights to eye) or a backwards direction (camera to lights).
Thus <e h m h> <t m h> <s>
is equivalent to <s> <t m h> <e h m h>
Tokens
[edit]Many renderers have developed slightly different event syntax.
Event Description | H&V | Iray | OSL | RenderMan |
---|---|---|---|---|
Light Sensor (s) | ||||
Eye/Camera | E | E | C | C |
Event Modes (m) | ||||
Diffuse | D | D | D | D, D1, D2, etc. |
Glossy | G | G | G | see specular |
Specular | S | S | S | S, S1, S2, etc. |
Transparent | s | |||
Emission Types (e) | ||||
All Lights | L | L | L | L |
Object Light | La | O | O | |
Area Light | La | |||
Point Light | Lp | |||
Infinite Light | Le | |||
Environment/Background | Le | B | ||
Scattering Types (t) | ||||
Reflection | R | R | R | R |
Transmission | T | T | T | T |
Volume | V | V | V | V |
Notes: H&V does not differentiate between transparency and specular transmission. H&V does not differentiate between light emitting object and other area lights. Directional lights are considered as being part of the environment/background light.
Common Outputs
[edit]Beauty
[edit]The beauty is the primary output of a render and contains all possible light paths. As the primary output, a LPE is generally not required; nevertheless, it can be expressed as:
H&V | Iray | OSL | RenderMan |
---|---|---|---|
L.*E | L.*E | C.*L | C[DS]*[LO] |
Alternately, you can render a beauty image without primary environment visiblility:
H&V | Iray | OSL | RenderMan |
---|---|---|---|
^(LeE) | C[DS]*L |
Diffuse Reflections
[edit]Direct diffuse lighting is typically referred to as simply 'diffuse' lighting.
L<RD>E
Indirect diffuse lighting is sometimes refereed to 'diffuse irradiance' and corresponds to finalgather.
L.+<RD>E
Glossy and Specular Reflections
[edit]Glossy and specular reflections are often grouped together. The direct path may be described as the 'highlight'.
L[<RG><RS>]E
Indirect glossy and specular reflections.
L.+[<RG><RS>]E
Transmission
[edit]All transmission paths.
L.*TE
Volumetric
[edit]Volumetric interactions are often buried within transmission paths. Nevertheless:
L.*VE
Emission
[edit]LaE
Note: LpE has no output
Langer & Zucker 1997 http://code.google.com/p/openshadinglanguage/wiki/LightPathExpressions