Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tanema/light_world.lua
A lighting model made for love 2d
https://github.com/tanema/light_world.lua
Last synced: 3 days ago
JSON representation
A lighting model made for love 2d
- Host: GitHub
- URL: https://github.com/tanema/light_world.lua
- Owner: tanema
- License: mit
- Created: 2014-10-24T17:53:44.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2021-11-20T01:14:24.000Z (almost 3 years ago)
- Last Synced: 2024-08-02T06:17:56.795Z (3 months ago)
- Language: Lua
- Homepage: https://love2d.org/forums/viewtopic.php?f=5&t=78998
- Size: 7.7 MB
- Stars: 218
- Watchers: 16
- Forks: 18
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-love2d - Light World - A lighting model. (Lighting)
README
# light_world.lua
A library for Love2d to create a dynamic lighting system, supporting:
- Shadows for any shape
- Normal maps for 3d like reflections
- Glow maps
- Postshader effects
- Animations with normal mapsAll of this is base of a previous version made by [PriorBlue](https://bitbucket.org/PriorBlue/love2d-light-and-shadow-engine),
## Installation
Copy and rename the lib folder into your project.
## How to use
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.```lua
local LightWorld = require "lib" --the path to where light_world is (in this repo "lib")--create light world
function love.load()
lightWorld = LightWorld({
ambient = {0.21,0.21,0.21}, --the general ambient light in the environment
})
endfunction love.update(dt)
lightWorld:update(dt)
lightWorld:setTranslation(x, y, scale)
endfunction love.draw()
love.graphics.push()
love.graphics.translate(x, y)
love.graphics.scale(scale)
lightWorld:draw(function()
-- do your stuff
end)
love.graphics.pop()
end
```## Contributors
- Jon @xiejiangzhi
- Brandon Blanker Lim-it @flamendless
- @Azorlogh
- Gustavo Kishima @gukiboy
- Rose L. Liverman @TangentFoxy
- Kyle McLamb @Alloyed
- @Buckle2000
- Benoit Giannangeli @giann