Light blocker : constrain lighting in specific areas

Is it possible in Cycles to light objects only inside an area?

Like the light blocker you can find in some render engines: https://support.solidangle.com/display/AFMUG/Light+Blocker

For the moment, the only way I found is to separate lights in render layers and make the “blocker” with the compositor, but it is slower and very limited by the number of Blender’s layers.

Is there a light node setup or something else that could be used for that?

Create a mesh (as the area you don’t want the light to escape) and then give it a material of holdout, then disable visibility for camera and shadow (shadow is very important if you have non-ambient lighting outside the mesh).
Basically, the light blocker is the holdout material. simple as that.

Thanks for the trick!
But it seems to work only for environment lighting and doesn’t block lights.

Not sure what you mean. This should block lights from outside coming in, and lights from inside going out. At least it worked that way with me. can you give a screenshot?

You can always create a separate object and then disable its visibility to camera rays (while keeping visibility to other ray types).

This means that you couldn’t see the object, but light can’t go through it.

You would need to use renderlayers for that.

Create your blockers using the lightpath trick, then have the lights divided among multiple layers, then combine the lighting information in the compositor.

To do what you want without doing this would require that someone develops a light group system for Cycles (in which the rays would then be flagged according to their source light and accessible with the nodes).

Yeah, that’s what I suspected… too bad!

1 Like