How to create an effect for Hide n Seek game?

Is there a way for making an effect like this? It’s like a bunch of rays which don’t go through the meshes.
I don’t even know what’s the properly name of such effect :smiley:

It’s like a spotlight but with some limited distance. How do I get a behaviour like that? Rotating the light to the bottom? :smile:

You could do it with a spotlight (with intensity=0 so that it does not change the lighting of objects) + a shadow generator and reuse the shadow computation:

The PG assumes that there are only two lights in the scene and that the second one is the spotlight. If you add more lights, you should change the three light1 occurrences line 141 to light2/light3/… depending on the number of lights in the scene. However, the spotlight should always be the last light you create because the shader code is reusing the shadow variable used by the lighting computation, and for the effect to work the current value of shadow must be the one from the spotlight.

2 Likes

Wow so much new information for me on working with a spotlight and shaders. That’s exactly what I need.
Thanks!