mirror of
https://github.com/tanema/light_world.lua.git
synced 2024-12-24 20:24:19 +00:00
Merge branch 'master' of github.com:tanema/light_world.lua
This commit is contained in:
commit
2f19a07dc5
18
README.md
18
README.md
@ -1,6 +1,3 @@
|
|||||||
:todoing
|
|
||||||
-add body animations
|
|
||||||
|
|
||||||
# light_world.lua
|
# light_world.lua
|
||||||
|
|
||||||
This is the light modeling done by Priorblue [here](https://bitbucket.org/PriorBlue/love2d-light-and-shadow-engine),
|
This is the light modeling done by Priorblue [here](https://bitbucket.org/PriorBlue/love2d-light-and-shadow-engine),
|
||||||
@ -16,21 +13,33 @@ only it has been largely refactored and edited to allow for scaling and proper t
|
|||||||
local LightWorld = require "lib" --the path to where light_world is (in this repo "lib")
|
local LightWorld = require "lib" --the path to where light_world is (in this repo "lib")
|
||||||
|
|
||||||
--create light world
|
--create light world
|
||||||
|
function love.load()
|
||||||
lightWorld = LightWorld({
|
lightWorld = LightWorld({
|
||||||
ambient = {55,55,55}, --the general ambient light in the environment
|
ambient = {55,55,55}, --the general ambient light in the environment
|
||||||
})
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
function love.update(dt)
|
||||||
|
lightWorld:update(dt) --only needed for animation
|
||||||
|
lightWorld:setTranslation(x, y, scale)
|
||||||
|
end
|
||||||
|
|
||||||
function love.draw()
|
function love.draw()
|
||||||
love.graphics.push()
|
love.graphics.push()
|
||||||
love.graphics.translate(x, y)
|
love.graphics.translate(x, y)
|
||||||
love.graphics.scale(scale)
|
love.graphics.scale(scale)
|
||||||
lightWorld:draw(x,y,scale)
|
lightWorld:draw(function()
|
||||||
|
-- do your stuff
|
||||||
|
end)
|
||||||
love.graphics.pop()
|
love.graphics.pop()
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
For more information please check out the [wiki](https://github.com/tanema/light_world.lua/wiki) and see the examples directory to see how it is fully used. This project can be run with love to see the demonstrations in action.
|
For more information please check out the [wiki](https://github.com/tanema/light_world.lua/wiki) and see the examples directory to see how it is fully used. This project can be run with love to see the demonstrations in action.
|
||||||
|
|
||||||
|
### Gamera & HUMP
|
||||||
|
There are example in the example directory how to use both of these with the library.
|
||||||
|
|
||||||
## Features ##
|
## Features ##
|
||||||
* **[Preview (Video)](https://www.youtube.com/watch?v=6V5Dtsa6Nd4)**
|
* **[Preview (Video)](https://www.youtube.com/watch?v=6V5Dtsa6Nd4)**
|
||||||
* polygon shadow calculation [Preview](http://onepixelahead.de/love2d_polyshadow.png)
|
* polygon shadow calculation [Preview](http://onepixelahead.de/love2d_polyshadow.png)
|
||||||
@ -49,6 +58,7 @@ For more information please check out the [wiki](https://github.com/tanema/light
|
|||||||
* refractions (moveable) [Preview](http://onepixelahead.de/love2d_polyshadow13.gif)
|
* refractions (moveable) [Preview](http://onepixelahead.de/love2d_polyshadow13.gif)
|
||||||
* chromatic aberration [Preview](http://onepixelahead.de/love2d_polyshadow16.gif)
|
* chromatic aberration [Preview](http://onepixelahead.de/love2d_polyshadow16.gif)
|
||||||
* postshader with many included postshaders, plus easy to extend
|
* postshader with many included postshaders, plus easy to extend
|
||||||
|
* animations in tandem with normal maps thanks to [anim8](https://github.com/kikito/anim8)
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user