- Home /
How do I make one light source override all other light sources?
I'm working in 2D trying to make a top down game in darkness, I have a dim light source on the player's character and a brighter spotlight controlled by the mouse.
What happens right now is if the spotlight is moved over the player, the two light sources combine into an even brighter illumination. What I would like is for the spotlight to completely override the light created by the player's dim light, not combine with it.
Edit: I am open to alternatives to using lighting to accomplish the same effect.
I would make a raycast to check if spotlight hits the object and then turn off the dim light.
If the two sources only partially overlap, I would prefer the dim light still be visible in the parts that do not overlap.
Then your best bet is to try coding a shader which selects only 1 light source ( stronger one ).