← All ideas
  • Published 7 Feb 2023

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]

LightMask_Example_002_Page 3.png LightMask_Example_002_Page 4.png

My proposal is to add the three following nodes: LightMask_Example_002_Page 1.png 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] LightMask_Example_002_Page 6.png LightMask_Example_002_Page 5.png

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. LightMask_Example_003_Page 7.png

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). LightMask_Example_002_Page 9.png

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!

LightMask_Example_002_Page 2.png (For clarity on the namings)

100%

Development Status: Open

Upvote 35 Downvote 0
pau
7 Feb 2023

6 Comments

1D_Inc

I am not sure that node-based light linking can have clear explicit manageability, especially in massive project scenes

1
gwetell

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).

1
lsscpp

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!".

1
pau Author

Thanks for the comment! I hope this isn't the case anymore.

1
brechtvanlommel

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.

nebulon12121

Interesting. Does it work with Eevee? I have an Eevee scene that needs a wall object excluded from a light in the worst way.