...
In RenderMan, in addition to the built-in AOVs , LPE, light path expressions (LPEs), which is are adopted from Open Shading Language's Light Path Expression, specifies specify what light transport paths to output to a display channel. In other words, we don't have to modify the shaders or plugins to output a custom AOV that uses the LPE.
The setup is the same as an AOV except we use a light path expression instead of an AOV channel name. We can also use a short descriptive name (e.g. lpe:diffuse
) as well as the long LPE expression (e.g. lpe:CD<L.>
).
Additionally, we can group the outputs by light groups and/or by geometry set up by a lpegroup.
...
An LPE is made up of tokens which are not the most artist-friendly things. For this reason, we provide a list of built-in LPEs with short descriptive names and hide the non-artist friendly expressions.
RenderMan for Maya
In RfM, an LPE can be easily added by right click clicking on a an LPE name from the built-in LPEs list in RenderMan in RenderMan Controls' Add Channels/Outputs.
RenderMan for Katana
In RfK, an LPE is specified via PrmanOutputChannelDefinevia PrmanOutputChannelDefine. For a list of built-in LPE names, please see the Built-in LPEs table below.
RIB
For DisplayChannel, we can use either the short name or long expression, e.g., lpe:diffuse
or lpe:CD<L.>
.
Code Block |
---|
DisplayChannel "color lpe:diffuse" |
...
Built-in LPEs
Name | Expression |
---|---|
lpe:diffuse | lpe:CD<L.> |
lpe:specular | lpe:CS<L.> |
lpe:emission | lpe:CO |
lpe:indirectdiffuse | lpe:(C<RD>[DS]+<L.>)|(C<RD>[DS]*O) |
lpe:indirectspecular | lpe:(C<RS>[DS]+<L.>)|(C<RS>[DS]*O) |
lpe:subsurface | lpe:(C<TD>[DS]+<L.>)|(C<TD>[DS]*O) |
lpe:refraction | lpe:(C<T[S]>[DS]+<L.>)|(C<T[S]>[DS]*O) |
lpe:shadowcollector | lpe:shadows;C[<.D'collector'><.S'collector'>]<L.> |
lpe:reflectioncollector | lpe:C<RS'collector'>([DS]+<L.>)|([DS]*O) |
lpe:shadowcollector collects shadow for For objects that have a lpegroup called an LPE group called "collector"., lpe:shadowcollector
collects shadow and lpe:reflection
collects reflection for objects that have a lpegroup called "collector". These may be useful for creating holdouts.
Note |
---|
Note that the first eight of these expressions are both disjoint and exhaustive; any individual light path will match exactly one of them. As a result, rendering out all nine eight of them and then compositing them together will produce the equivalent of the beauty image. |
Caustics are not included in the built-in list because they overlap with lpewith lpe:indirectdiffuse
. However, you can select caustics with the expression lpeexpression lpe:CD[S]+<L.>
LPE Outputs
Carousel Image Slider | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
...
A custom LPE can be added in RenderMan in RenderMan Controls' Add Channels/Outputs:
RenderMan for Katana
Custom LPE is specified via PrmanOutputChannelDefinevia PrmanOutputChannelDefine's Add Source:
LPE Macro
If the custom LPE is useful for other shots, you can add your custom LPE by creating a macro in rendermn.ini
file. The custom LPE will appear in the RenderMan for Maya LPE list after relaunching Maya. For example:
Code Block |
---|
/prman/lpe/macro/myDiffuse CD<L.> |
Note |
---|
|
LPE Groups
An LPE group group (lpegroup allows ) allows us to specify which object(s) objects we want to be use for the an LPE channel.
RenderMan for Maya
In RfM, we add a an lpegroup by selecting the objects and add the lpegroup RenderMan attribute.
RenderMan for Katana
In RfK, we add a an lpegroup via PrmanObjectSettingsvia PrmanObjectSettings' attributes/identifier/lpegroup.
RIB
Code Block |
---|
Attribute "identifier" "string lpegroup" ["ground"] DisplayChannel "varying color plane2Shadow" "string source" ["color lpe:shadows;C<.[DS]'ground'><L.>"] |
Predefined
...
LPE Groups
For the built-in LPE such as shadowcollector or reflectioncollector, it assumes a predefined lpegroup named "collector". So for the objects that we want to collect shadow or reflection, we can simply name its lpegroup to "collector". Specifying lpe:shadowcollector
will collect the shadow for these objects.
Advanced
...
LPE Group Logic
You can use the usual regular expression character classes syntax to define more complex LPEs by considering each lpegroup as a single charactertoken.
For instance, provided you are using lpegroups "foo" and "bar", you can define the following LPEs:
...
For instance, say we have a light group named "key":Using LPE name. The following are both valid LPEs:
Code Block |
---|
DisplayChannel "varying color lpe:diffuse_key" |
Using LPE name:
Code Block |
---|
DisplayChannel "varying color lpe:CD<L.'key'>" |
Per-Lobe LPEs
Bxdfs Bxdf materials may have more than one diffuse or specular lobe which are summed for D and Sfor D
and S
, respectively. However, in some situations, it may be desirable to output a specific lobe separately.
For example, some PxrLM PxrSurface materials have a Clearcoat lobe. Normally this is summed under the S tokenthe S
token. Routing this lobe to the S2token the S2
token will allow you to use S2 in your LPE'suse S2
in your LPEs. Up to 4 diffuse lobes and 8 specular lobes are available for LPE'sLPEs. By default, S1 contains S1
contains all the specular lobes, so use any higher tokens such as S2 for as S2
for your per-lobe LPE's.
Code Block |
---|
Option "lpe" "string specular2" ["Clearcoat"] DisplayChannel "color lpe:CS2<L.>" |
This will cause a slight performance penalty but may be desirable to see lobes independently.
LPE Prefixes
unoccluded
- – returns unoccluded result.noclamp
- – returns unclamp unclamped result.nothruput
- – does not apply thruput (thruput is the accumulative albedo of the rayhit objectobjects hit by rays).shadows
- – returns collected shadows.holdout
- – holdout LPE that directs the LPE output to the beauty channel.overwrite
- – instead of outputting the accumulated result, overwrite it. One example of using this is for the albedo output where we do not want an accumulated result.noinfinitecheck
- – do not do any infinite check.
LPE Tokens
C
– cameraD
– diffuseS
– any specular * (includesS1
specular1 * ,S2
specular2 * , ...)D
– any diffuse * (includesD1
diffuse1 * ,D2
diffuse2 * , ...)R
– reflectionO
– emissive objectL
– geometric area lightT
– transmission (refraction/subsurface)<>
– specifies <ScatteringType ScatteringEvent lpegroup>- Scattering types:
L
(light),T
(transmission),R
(relection), orO
(emissive object) - Scattering events:
D
(diffuse),S
(specular)
.- Scattering types:
- lpegroup: This is optional
. If - ; if specified, the LPE only applies to that lpegroup
.()
is – for grouping.[]
is – for regular expression.[]*
means 0 or more.[]+
means 1 or more.- U – user defined signals (selected by number,
U1
through U12
)
User Defined
...
Signals
U
token specifies tokens specify a user defined signal. A Bxdf can output any user defined signal via the RixBXLobeWeights class. There are twelve of them, fromU1
to U8U12
. By default, all user defined signals are set toU1
.- If you have more than one user defined signal, it is important to direct each user defined signal to a different
U
token by setting them inrendermn.ini
. Otherwise, all user defined signals that are assigned to the same U token will override each others! - By default,
U2
is set to the albedo output in the installedrendermn.ini
.:
Code Block |
---|
/prman/lpe/user2 Albedo |
Examples
- <L.> means Light scattering type with all scattering events. For light group AOVs, using <L.> is required instead of L.
- lpe:CD<L.> means camera with diffuse scattering event for light scattering type.
- lpe:CO means camera with emissive objection (since emissive does not need any light, there is no L).