Home Creators Posts Import Register Favorites Logout

Content

Gaffer has added many great new features in recent releases, foremost among them being light and shadow linking in Cycles and RenderMan! Let’s take a look at what these do and how to set them up.

Light linking allows us to isolate specific lights in a 3D scene and make them affect only specific objects. Shadow linking works similarly, letting us control which lights cast shadows from which objects.

Typically, we aim for a “physically correct” setup in which every light affects every object. In a real-world photo studio, there’s no way to make a light affect only the left eye of a subject—it’s all or nothing. This approach often looks best in CG as well.

However, we can break from reality for greater control over the scene. For example, a small light could add highlights to a character’s eyes. Without linking, a tiny, bright light might cause unwanted highlights on hair or skin. By linking the light to only the eyes, we gain precise artistic control without unintended side effects.

Most DCC apps and renderers offer some form of light linking. We’ll focus on Gaffer here, but the concepts are universal.

Let’s look at a simple Cycles demo scene. We’ve got two lights, left and right, two objects, and a backdrop.

The lights are named light_l, and light_r. In Gaffer, all lights start out as part of the defaultLights set, meaning they automatically affect all objects in the scene.

To enable light linking on an object, attach a Standard Attributes node and create a Path Filter for the object. In this case I'll isolate the mustard bottle. Open the Light Linking section and turn on Linked Lights. Linking a specific light is as easy as dragging it from the Hierarchy View into the Linked Lights text box. You can also type multiple lines by pressing Enter after each one. Ctrl-Enter confirms the edits and exits the text box.

There we go! Now the mustard bottle is lit only by light_l.

To revert to defaultLights, simply type it in (Gaffer offers to autocomplete it):

We can enable shadow linking by following the same process in the Shadowed Lights section. Here, the mustard bottle casts shadows only from light_r. Note that this removes the shadows from the right side of the bottle. Those are self-shadows from light_l.

These techniques scale up no problem to huge, complex scenes. Gaffer’s more advanced filtering rules make selecting multiple objects a breeze. For example, here we linked the caps to the right light and the bottles to the left using /*/cap and /*/bottle Path Filters. Easy! (But also looks pretty weird!)

Files

Comments

No comments found for this post.