This WebGL demo showcases a real time 2D lighting method I've experimented with. The scene is lit by determining the shadow/darkness contribution at each pixel, taking into account obstacles. A pixel is processed once for each of the lights in the scene. On every iteration the pixel is lit based on the distance from the light, scaled by the darkness factor from the obstacles between the pixel and the light. Soft shadows are achieved by scaling the darkness factor based on the pixel's position behind the obstacle. Additional details can be found on the blog post about the technique.

Moving the mouse around the inside of the demo area will move the purple control light. Clicking the mouse will toggle a bloom/blur effect.