Skip to content

Tutorial: AOV's and LPE's for Dummies (and the rest of us)

Jon D edited this page Nov 10, 2016 · 13 revisions

#Introduction# AOV (arbitrary output variable) and LPE (light path expression) features are some of the more powerful ones found in PRMan.

What is an AOV?

When PRMan renders a 3D scene, it will output a 2D image with all the lights and objects present. However, behind the scenes, PRMan is collecting all kinds of data about the scene as it renders. Things like where objects are located, how their normals appear, what light paths are doing at each bounce and what objects are being hit by them. AOV's allow a user to access a subset of that extra information and output it in a file. These files can then be used in a compositing application, and might drive everything from a slight tweak to something like relighting the entire image.

What is an LPE?

An LPE is a particular type of AOV that allows you to isolate specific light ray types and objects in your scene. You can use this feature to, say, isolate all the specular reflection events on an sphere for later tweaking.

Great! So what are the downsides?

Exporting AOV's takes extra memory and can slow down the render a bit as PRMan sorts through it's data to populate the AOV image.

##How to use custom AOV's
In the Layers tab, press the button that says 'use Renderman AOV's'. This will create a new box at the bottom where you can select from a number of Renderman's pre-defined AOV's. These AOV's cover pretty much any kind of extra information you'd need from a scene. ##How to use custom LPE's
The non-data AOV"s are generated through LPE's. Each one isolates a particular type of lighting in the output image. In addition to isolating the type of lighting, you can also isolate particular light or object groups. This is done with the search boxes in the layer tab.

If you want to create pass types that aren't covered by the pre-selected options, you can also use the custom dropdown to enter a raw LPE string. Be careful when doing this, while you won't break anything by entering an invalid LPE, you do need to make sure that you follow the formatting requirements, otherwise you'll be greeted by a blank image

LPE Syntax: The LPE syntax can appear daunting, but it helps to picture the instruction as an order of lighting interactions from left to right. For instance, take the following LPE:

lpe:CD<L.>

Left to right we have a camera, followed by a diffuse bounce, ending at a light. In other words, direct diffuse lighting. If we wanted to capture ALL diffuse lighting (including bounce lighting) we can modify the LPE to add a '*' wildcard, which indicates '0 or more' occurrences of the event. So if we use lpe:CD*<L.> we will go from the camera, to any number of diffuse interaction (reflection or transmission), to a light. You can begin to see the power of the LPE system and how almost any kind of path can be represented with them. For instance, if you wanted ALL the contributions of a particular light, you can use lpe:C[DS]*<L.'name of light group'>. Let's break that LPE down: Start with the camera, then go to any combination of diffuse and/or specular bounces (this is called out by the brackets), then ending at a light with the listed group name. To add even more customization, a bounce can be further broken down to either an 'R' reflection or 'T' tranmission. So, for instance, if you wanted refraction for a particular light, you could use lpe:C<TS>+[DS]*<L.'name of light group'>. Let's break that down..... Camera, to one or more specular transmissions, to zero or more diffuse/specular bounces (called out by the star sign) to a light. We need to use the 'one or more' argument in this case on the specular transmissions because if we didn't, the ray could potentially reflect into a light at that first specular transmission hit, which wouldn't give us the right result.

Additional documentation can be found here. While Renderman's LPE syntax is based off the guidlines set by OSL (Open Shading Language), it is not a full implementation, so not all features are available.