Page tree

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

Contents

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.


In production it often become 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.

Some examples of the power of LPE are the ability to:

  • Allow for additive compositing, preserving the physical nature of the image and avoiding artifacts through multiplication or division in post processing.
  • Output a specific bounce of light (2nd, 3rd, etc.) or even a range of bounces (4th to 8th bounce of light). You can use this to isolate effects or even noisy bounces for subtraction.
  • Output a specific object to an LPE. While you can use Cryptomatte to isolate objects with an ID, you can also output the object or collection of objects and their contribution separately.
  • Isolate a particular noisy light path for subtraction in comp or an LPE without these light paths to composite.
  • Create a non-physical effect like differently colored caustics from their source, change the color cast of an object, or scale lighting.
  • Output per-light AOVs for manipulation later.

Note that trace sets can also be used to accomplish some of these effects but since trace sets are global in the render, LPE will obey these trace sets (meaning data that would have been collected otherwise is restricted by the trace set).

LPE, Cryptomatte, and Trace Sets should improve the flexibility of your pipeline and when managed correctly, avoid expensive re-rendering for artistic tweaks.

The Basics

To understand what is collected in an LPE, we will talk about the parts below and some context. Firstly, we always begin at the camera, so we begin an expression using C for Camera as the starting point for light collection.

Scattering Types

Light is scattered when it strikes an object. It is either reflected off, absorbed, transmitted, or some combination of the three. In the LPE syntax we list two types of events:

  • Reflected Light (R) is light that reflects off the object and back into the scene. This light carries information about the objects reflective properties like its diffuse color and what the object might reflect more sharply of other objects around it.
  • Transmitted Light (T) is the light that transmits into and possibly through the object. Subsurface scattering is a very diffuse transmission of light. Refractive objects have a sharper specular transmission of light through the object.

The tokens for these events are are R and T as shown above. You may specify which you want to collect or both. Later we will discuss some shorthand for specifying either but for now we'll use the tokens. Light that is absorbed is handled by the material itself and since it doesn't travel back into the scene (its energy absorbed like light in the real world) we don't collect it.

Below is a beauty render and the diffuse transmission effects rendered alone in an LPE. This includes translucency and subsurface scattering.

Scattering Events

A scattering event is light scattered from a reflection or transmission. In RenderMan we provide two events and one special User event:

  • Diffuse (D) scattering events are the type we associate with diffuse surfaces like paper, rough wood, skin, dust, cardboard, etc.
  • Specular (S) events are shiny or dielectric type scattering. This covers things like shiny car paint, metals, plastics, water, glass, etc.
  • User (U) events are available to shader writers interested in using them to store some other information. While mentioned here, the documentation will cover the D and S events.

You can specify a chain of events if you like, such as DDS, meaning Diffuse event to Diffuse event to a Specular in that order. The LPE would collect anything that happens in this specific order and store them. For simplicity we'll cover more common cases first.

Direct and Indirect Light

In ray tracing images, we mimic what happens as light travels through a real world scene.

  • Direct Lighting is when light from a source strikes an object directly without anything between the light and the object and seen by the camera. Imagine a flashlight on the wall, the sun on a sidewalk, or the light from this screen onto your desk. That's direct lighting.
  • Indirect Lighting is when light has already interacted with others objects before reaching the camera. Imagine a mirror, the light is illuminating everything that is seen indirectly in the mirror (you're lit by a light that then bounces to the mirror and then into the camera, you're seeing the effect of lit objects indirectly in the mirror). Or a whole room can be lit up by a window where the sun is only shining on the floor. These are all indirect lighting examples. Huge amounts of information in our daily lives is indirect. Right now you may be in a room where fixtures cover the lights, that means everything you see is indirectly lit.

There is a funny thing about specular objects without diffuse shading, they only look like the things they reflect. If you were to render the Cornell Box scene examples with perfectly specular surfaces and a light, all you would see are reflections of the light. What does a mirror look like? Can you describe a mirror that has nothing to reflect? Or does the mirror look like what it's reflecting? This is why indirect results are so important for realism and ray tracing.

 

A diffuse scene using subsurface and translucent (both called diffuse transmission) effects.

A specular scene using iridescence and transmission (glass).