- Home /
How to make point lights not overlap
Hi, I'm using sprite/diffuse and I have a question regarding point lights, is there a way to make them not add their brightness when overlaping? I made an image as example:
So case A is how it works normally, light is brighter where both lights overlap.
Case B is what I want to achieve. Any ideas on how I could make this?
(Sorry for my poor english)
$$anonymous$$y assumption would be to use the $$anonymous$$ax blend operation when writing the forward additive pass for the shader, rather than Add. This wouldn't necessarily work, and requires a fair bit of knowledge about writing shaders the old fashioned way, however.
Well, lights are additive; they ADD; You could however write some very customized shaders for lighting; But maybe ins$$anonymous$$d you should try to describe what exactly are you trying to achieve as there might be a better way than using lights
I don't want my sprites to look brighter than their original color when there's more than one light nearby, I have a day/night system, for "day" I have a directional light with intensity of 1 (using sprite-diffuse) and it looks pretty much like if I was using sprite-default (so the original sprite colors). Then I decrease the intensity of that global light to 0 for night and it looks pretty dark. $$anonymous$$y problems are 2: when it is daytime (so directional light is 1) and I have other lights (like torches or whatever) and then the player walks by and gets brighter, which looks bad (too white), I want that intensity of the directional light to be the max possible light intensity for the sprites. The second problem is when it's dark and there like 4 "torches" side by side and the same happens.. it's just too bright.
Torches are generally much less intensive than sun, and this case would normally be solved by rendering in HDR, having the sun much much brighter than the torches, and using some exposure adaptive postprocessing (the effect that simulates the eye iris getting used to the light level). That way, torch lights would be practically ignored during day (because sun is so much brighter) and become significant when the sun doesn't shine (because the eye adaptation would icrease exposure until the torchces become significant). But that would require you to use potentially expensive techniques. So why not simulate it yourself? Have some light script that you attach to every light, control the global 'intensity' multuplier from there (as a replacement for the eye exposure). When the night comes, you increase all lights globally, but tune down the sun, making everything else brighter.
Or, if you really just want to get exactly what you are saying, and you are not using any kind of directional information (specular lights, normal maps), you could just render lights to some kind of g-buffer, clamp the intensity there, and then render your scene not with lights but with this buffered lighting information
Your answer
Follow this Question
Related Questions
How do I get the positions of lights in the scene in 2D shader graph? 0 Answers
Why do 2D Lights render past shadowcasters. 1 Answer
How to make lights overlapping not to add their intensity? 0 Answers
Extrange Behaviour with 2D Lights in Universal RP 0 Answers
Why my 2D shadows have low resolution? 0 Answers