Update: 2014/02/03 Working subtractive lighting system
https://gist.github.com/seanpackham/8727943
Original Post
Hi all, first post here. I want to start by saying Love2D is by far the easiest and quickest 2D framework I have encountered and it is due to the great community and authors. Thank you for all that you have done!
I have been implementing lighting and shadows for a prototype I am making http://forums.tigsource.com/index.php?topic=38448.0 but have hit a wall. I am not too clued up on blend modes, stencils and cavanses and this is currently where I am:
I have been following these great resources:
- http://forums.tigsource.com/index.php?topic=8803.0
- http://experimentalized.blogspot.com/20 ... sting.html
- http://lwjgl.org/forum/index.php/topic,5203.0.html
- https://github.com/DrAgonmoray/BasicLighting/
- http://www.youtube.com/watch?v=nSf1MpsWKig
- http://www.youtube.com/watch?v=Gy9tvA9AlSg (user oysi93 implemented his lighting in love2d)
I have completed the shadow generation, and in the code have drawn the shadow polygons with an alpha to demonstrate multiple shadows overlapping but generally they should be opaque. I have included a port, with some minor changes, of the fragment shader from resource link 4 above.
I have not been able to correctly blend the various states (geometry/background, shadows, lights).
I was wondering if any lövers out there could give me some advice? Perhaps a lightmask solution is easier than using a shader...
Here is a gist of the code https://gist.github.com/seanpackham/8727943
Thanks