Disabling specific light, or light type for a specific material/mesh

Hi,

In my game, I have a huge cylinder mesh that is used as “background” (a sort of skybox, except that it has no top or bottom). All my scene is inside it.
It seems that all point-lights (inside it) always transmit full light intensity to this object. Probably the distance is not computed for each mesh’s face but from the mesh origin.
So I would like to turn off all point-lights (and eventually spotlights) for this specific mesh (or for its material), but I would like to keep hemispheric light (or eventually directional light, or any world wide light) so that when the night fall, the background is automatically darkened just like every other objects.

Is it possible?

You can exclude meshes from lights:

Or include meshes in lights:

Would that work?

It requires a bit of work to register/unregister things every time a light or a background is added/removed, but I guess that could work.

Thanks :wink:

1 Like