Can anyone explain what is happening here and ideally tell me how to fix my lighting issue? I really don’t understand why increasing the light’s size makes a difference.
Context
My scene contains a few torches that have lights (Blend mode: Add) and a light that is set to blend mode subtract. It covers the entire screen to make my scene dark and moody. When I spawn in enemies the smaller torch lights are completely ignored and the sprite is only affected by the global subtract light.
I noticed that the torch lights started working when I increased their size to cover the entire screen as well.
Images
I got an error when I tried to add my images to this post directly, so here is a link to imgur.
This is a mathematical problem. You are using both additive and subtractive lights, but you are expecting them to work linearly. They work exponentially. A light’s center will have the maximum contribution and the edge is where it reaches zero, but it is an exponential decay along the radius.
This means a very big lamp will have a much larger contribution per area (aka pixel) than a smaller one of the same intensity.
In any case, negative light is ill suited for this. You should just make the default amount of light closer to zero. Do you have a WorldEnvironment? How does light affect those sprites exactly? Explain how it works so it’s easier to help you make it work how you want.
I don’t think the decay is the problem. The smaller torch lights still don’t work if I turn off the global subtract light. The enemies are only affected if my entire tilemap is covered by the light. Making it cover just 99% of the tilemap seems to completely “shut off” the light. It’s like a threshold it has to cross.