Light Linking
Needs ReviewPublic

Authored by Tod Baudais (tod_baudais) on May 9 2016, 8:41 PM.

Details

Reviewers
None
Group Reviewers
Cycles
Summary

Adds light linking controls to the groups in cycles. This allows you to tie lights to objects within a scene and generally give you much more control over the look of your shot. It also gives you the same controls for shadows (i.e. this light causes shadows on this object but this other light does not). Caveats: Bounce lighting was not enabled for this production and this code doesn’t take into account bounce lighting at all. However our next production will most likely have bounces enabled so further work will be done on this.

The light linking settings basically have two states for lights and shadows - inclusive and exclusive. Setting the light linking to Inclusive allows lights from both inside the group and lights not in a light linking group to contribute to lighting. Exclusive only allows lighting from within the group.

NOTES:
Please find attached one of several patches for Blender and Cycles from Tangent Animation that were implemented for the production of Tangent’s latest film, Run Ozzy Run. It is our hope that these features will make it to the master branch of Blender as we have found that they are necessary for our production environment. You’ll find that these features either decrease render times or allow the director to more easily meet his vision on time and on budget. They are not intended to be accurate or physically correct.

Diff Detail

Tod Baudais (tod_baudais) retitled this revision from to Light Linking.May 9 2016, 8:41 PM
Tod Baudais (tod_baudais) updated this object.
Tod Baudais (tod_baudais) set the repository for this revision to rC Cycles.

Thanks for contributing these patches! I wasn't even aware there was a film being made with Cycles as the renderer.

My impression is that these are mostly features to make rendering without GI more efficient, whereas for Cycles the design goal has always been render with GI and optimize around that. While all these things are good ways to keep render times very fast, it's using Cycles in a way that doesn't really fit the original vision. I fear that adding back too many of these tricks will make it harder to do certain optimizations and improvements in the future, and will lead to bad workflows for users.

Light linking is a feature that is typically used when shaders do not react reliable under different lighting conditions, either because they have some kind of energy conservation problem or because GI is missing and important to get consistent lighting. For example hair without multiple scattering can look very wrong, and in Sintel light groups where used to light the hair separately to compensate for that. While we can improve the hair shaders a lot still, with more recent Cycles open movies the hair behaves more consistently under lighting.

What we should aim for is to improve the shaders so that light linking isn't necessary.

You're very welcome! Blender has been an awesome tool for the studio and this is the least we can do! I'll get someone from production to comment but basically it's a film vision vs. realism tradeoff thing.

UPDATE: Here's what production said...

"It's not that there are issues with shaders - it's that there's still a want to provide for character based lighting (or supplemental lighting for any assets) without affecting the surrounding elements. Think about a combination of environment lights + simple 3 point lighting to enhance the characters."

"Adding a bit of rim lighting to a character without affecting the environment is very important for Features. If we can't do this, then it's unlikely that we'd use the renderer as a feature based renderer, even with GI turned on."

Light linking is essential for product visualization. We often get requests for lighting that would be impossible in a studio but possible in CG (if there was light linking). Right now we can hack it somewhat by using diffuse shaders and glossy shaders with 100% roughness and making a distinction via the light path node, but there are too many situations where this approach does not help.

@Brecht Van Lommel (brecht) light linking has a lot of use cases. The one you mentioned is just one out of many. We're living in the age of GI and people are still faking rim lights in Cycles using the normals trick because due to the lack of light linking there is no way to get a proper rim :(

An even better system than light linking would be ray tagging so visibility options would work for any object or material, not just for lights.

I agree there's some specific cases where it's useful, but also know it gets used a lot to work around deeper issues. I'm not against adding this feature in principle, but also like to see the specific use cases enumerated so that we can understand it better and implement it the right way. Rim lighting for specific characters seems like a good use case, but would also be interesting to hear what shadow linking was used for.

Regarding the implementation, one important optimization could be to have a different light distribution CDF for each combination of lights that is used in the scene. Otherwise you end up sampling a lot of lights only to discard them immediately. Though if you're using branched path tracing with "sample all lights" it's not so much a problem to loop over a few lights that you discard quickly.

Adding a function like object_in_shadow_linking right in the middle of BVH traversal likely also has a significant performance impact for scenes that do not use shadow linking. It might be faster on average to do this check after the intersection has been found, or even to force relevant objects to be instanced so the check can be done once per object.

Ray tagging to me sounds incompatible with bidirectional methods and light sampling optimizations. So if there's important use cases for that again it would be interesting to hear actual examples of why it's needed.