Hi, I’m trying to simulate sharp cut-offs akin to projector headlights found on most modern cars today. I’m working on a racing game and using realtime spot lights as headlights for cars, but by default they all generate a blurry gradually attenuated conical shape for brightness, when they fall on objects in front of the car’s headlights.
I tried using a simple cube placed in front of the car blocking the upper part of lights, that works in scene view. But as soon as I stop rendering the cube in game camera by culling it’s layer, the lights no longer get blocked. Also, this method seems Super inefficient as this game will be on mobile.
Searches on this specific topic brought about nothing. I’m on Built-In.
I’m sure there must be an efficient way to write a custom script/shader where I stop rendering bright areas above a particular height, then use a cookie image to simulate that bluish cut-off point as well as the irregular shape. (As shown in image)
I just don’t know where/what to start though.
What I want: