Löve "Light vs. Shadow" Engine v2
Posted: Fri Oct 24, 2014 6:49 pm
Hey everyone, So I found this http://www.love2d.org/forums/viewtopic.php?f=5&t=77418 topic a while ago and love the light engine but it didn't react well to scaling at all so I rewrote it here! https://github.com/tanema/light_world.lua
Some changes I made:
- rewrote the codebase to be much easier to extend and modify
- scaling works now
- translation works with by passing it into the draw call
- took out all the globals and love namespacing
- made the postshader independant from the project so you can use the postshader on its own but it is also nicely coupled into the light_world so you dont have to worry about canvases if you are using both
- made it easy to drop a shader into the postshaders dir and it will work with provided arguments.
- made all paths relative to the lib directory so that the folder can be placed anywhere.
Some todos I would like to do is:
- take into account rotation and shear on objects and camera.
Version 2 [RELEASE] Added new attachment to show new stuff
- I optimized how normals/shine/shadows are all drawn. They are all now drawn as an overlay instead of needing a background call and a foreground call. This should speed up the library as a whole as well.
- because of the previous point I simplified how the library is called for drawing hopefully making it more simple
- Added animations using anim8. I integrated this into the library because I need to keep track of the normal and spritesheet animations at the same time. (I will be adding documentation for this slowly but there are examples to show it off)
- Added an example of how to use the hump camera and the gamera camera.
Worked with karai17 and got STI support
- added new example to show STI functionality check out the 2.1 love file
Note Also I created this tool for my own use to generate shitty normal maps for spritesheets, also I use it to trim CrazyBump normal maps (get rid of background from spritesheets) just thought you might like to use it as well https://github.com/tanema/myspritenormaltool
Important! just published an update that will now require update to be called on your light world. This optimizes range checking of light bodies. Please see the github page for an example of how to do so. There have been significant speed optimizations though please check them out and tell me how it goes.
Some changes I made:
- rewrote the codebase to be much easier to extend and modify
- scaling works now
- translation works with by passing it into the draw call
- took out all the globals and love namespacing
- made the postshader independant from the project so you can use the postshader on its own but it is also nicely coupled into the light_world so you dont have to worry about canvases if you are using both
- made it easy to drop a shader into the postshaders dir and it will work with provided arguments.
- made all paths relative to the lib directory so that the folder can be placed anywhere.
Some todos I would like to do is:
- take into account rotation and shear on objects and camera.
Version 2 [RELEASE] Added new attachment to show new stuff
- I optimized how normals/shine/shadows are all drawn. They are all now drawn as an overlay instead of needing a background call and a foreground call. This should speed up the library as a whole as well.
- because of the previous point I simplified how the library is called for drawing hopefully making it more simple
- Added animations using anim8. I integrated this into the library because I need to keep track of the normal and spritesheet animations at the same time. (I will be adding documentation for this slowly but there are examples to show it off)
- Added an example of how to use the hump camera and the gamera camera.
Worked with karai17 and got STI support
- added new example to show STI functionality check out the 2.1 love file
Note Also I created this tool for my own use to generate shitty normal maps for spritesheets, also I use it to trim CrazyBump normal maps (get rid of background from spritesheets) just thought you might like to use it as well https://github.com/tanema/myspritenormaltool
Important! just published an update that will now require update to be called on your light world. This optimizes range checking of light bodies. Please see the github page for an example of how to do so. There have been significant speed optimizations though please check them out and tell me how it goes.