LIGHT MASKS - A new approach to light linking
By now, the asking for light linking in Cycles has become a late motiv for the ones who follow Blender's development. Since there's a lack of design proposals on how such a feature could be implemented in a Blender friendly manner, allow me to propose one.
LIGHT MASKS FOR SHADER NODES
Cycles can already mask light rays thanks to the light path node, for example:
- If a light ray is a specular bounce output 1, if not 0 [Image 2]
- If a light ray is close enough to the light source output 1, if not 0 [Image 3]
My proposal is to add the three following nodes:
They would function as follows:
- If a light ray has bounced through the desired object/material/collection output 1, if not, output 0.
By plugging it to the strength of a lamp you'd essentially have a light that shines only at a given object while keeping the rest at 0 (voila!). [Image 5] It would also have an "inverse" checkbox to produce the opposite effect. [Image 6]
What's great about it is that you're not "linking" a light to an object as much as masking the existing light rays depending on the object.
This means not only that it integrates much better with Blender (as it would live in shader nodes), but it's much more powerful, allowing this masks to be used as you please. For example, making a light shine a different color or intensity on a certain object. Just imagine the possibilities.
By using the other two nodes, you could also mask materials or entire collections.
Going object centric? No problem. Mask out the light form the object's material [Image 9]. It'd be great though to have a way to mask an object within a material (similar to the random output in the object info, but selectable).
Please note that the result of "masking out" an object from a light may not be identical to what you'd get from "unlinking" an object from a light in other software. One, coming from other workflows, may expect unlit objects not to cast shadows. That's no problem either! Just use the mask of the light that's casting the shadow to drive the transparency of the object's material.
That's it. That's the proposal. It should feel as easy as using a cryptomatte in comp with the interactivity of rendering in Cycles. A small impact on other areas of Blender, a huge leap for us lighting nerds!
Feedback appreciated!
(For clarity on the namings)
6 Comments
I am not sure that node-based light linking can have clear explicit manageability, especially in massive project scenes
Yeah I'm thinking the same. I'm not against this proposal, it looks interesting, but I'm not sure if this is faster and easier to work with than the simple yet effective light linking panel that Maya has for example. But I would like to have SOMETHING asap in Blender since this is one of the few features that I really miss coming from Maya (the other being render layers, Blender really needs something like this to).
Upvoted, but... Many years ago I asked if in the light path node could be implemented a sort of 'tag' output. The answer was something about "For how a pathtracer works, no!".
Thanks for the comment! I hope this isn't the case anymore.
There were some earlier proposals about shader based light linking, I think this comment still summarizes why it's not a good fit for production: projects.blender.org/blender/blender/issues/68915
Performance and USD compatibility are also difficult with this.
Interesting. Does it work with Eevee? I have an Eevee scene that needs a wall object excluded from a light in the worst way.