Now some dynamic lights have diffusion too (as long as they don’t move because computing the diffusion during movement would probably slow down the game).  You can throw those lights against a wall and they will glow here for a while.

Without diffusion, it looks terrible (compared to static precomputed lights). Here I threw a light in the small left room. See how the beam going through the door is harsh. That’s a pure pixelized FOV zone.

Now if I render this light alone, blur the resulting image and use this as a diffusion coefficient map, I don’t need to compute the light fov anymore as the information is precomputed in the diffusion map. I just scan the cells at range and put the light color multiplied by the diffusion coefficient. I didn’t do a benchmark, but it’s not impossible those lights are faster than non diffuse lights (as long as they don’t move of course).

And here is how it looks now :

3 comments so far

Add Your Comment
  1. There’s one subtle addition you can make. Walls should be lit more brightly than floors, because the angle of incidence is oblique. You can do this by adding a term to account for angle of incidence on floors (thereby undoing all your beautiful tweaking), or just multiply the brightness of walls by a constant (something around 4 or 5 should do). I didn’t notice until starting to play the demo that this seemed off.

  2. Yeah, there’s something wrong with the walls. Not only the intensity, but the way the lit walls and the “memory” map are mixed is wrong. It seems like the light darkens the walls.

  3. This is really nice looking, really like where you went with the lighting.