2D Lighting with Shadows
Posted: Tue Jul 23, 2013 11:09 pm
Hi,
i thought i would relax during holidays but it is so much fun programming with Löve so i did another program
This time it is a little demo of a lighting simulation with shadowing. You can dynamically insantiate lightsources also you also could insert over a thousand light sources (well fps would be very low than but in fact you could do that).
There are also some optimizations like every light source is only drawn when it is on screen or only the part of the image is will be redrawn where the light source actually is. I could add another optimization that only the polygons are checked that are on screen but thats future work.
Until now the shadowing only works with convex polygons. I will see if i will fix it in future.
Has anyone an idea why the lighted areas aren't smooth? Solution of this problem must be somewhere in the shader but i cant find it :/
i thought i would relax during holidays but it is so much fun programming with Löve so i did another program
This time it is a little demo of a lighting simulation with shadowing. You can dynamically insantiate lightsources also you also could insert over a thousand light sources (well fps would be very low than but in fact you could do that).
There are also some optimizations like every light source is only drawn when it is on screen or only the part of the image is will be redrawn where the light source actually is. I could add another optimization that only the polygons are checked that are on screen but thats future work.
Until now the shadowing only works with convex polygons. I will see if i will fix it in future.
Has anyone an idea why the lighted areas aren't smooth? Solution of this problem must be somewhere in the shader but i cant find it :/