Hey all!
I’m trying to wrap my head around the additive nature of attenuated light sources in a tiled 2D scenario.
Pictures!
Here’s the current method of calculating a light source (linked because they’re too big for this post):
The light at the source point is at maximum brightness. The light then bleeds off around 30% per tile’s distance from the source, ending when the result is zero or below.
Assuming that I’m starting with a blank light map (zero light), how do I get to a situation where I’m accurately ‘blending’ other cell’s light levels?
Consider the following example:
Here, multiple light sources intersect. This is a photoshop mockup using alphas that roughly represent the same light levels I’m actually using in-game. But the principle seems to work well - the alphas that overlap seem to add together to give a blended equivalent.
Is the principle as simple as adding the result of a light source calculation to the existing cell’s light level? So assuming a blank ‘zero’ light starting point, I simply add each light source’s attenuated light level to the cell’s existing level?
I feel like I’m missing something, so hopefully some guidance will help steer me away from certain disaster!
Thanks!