Giter Club home page Giter Club logo

light_world.lua's Introduction

light_world.lua

This is the light modeling done by Priorblue here, only it has been largely refactored and edited to allow for scaling and proper translation.

Supports love 0.10.1

Installation

Copy and rename the lib folder into your project.

How to use

local LightWorld = require "lib" --the path to where light_world is (in this repo "lib")

--create light world
function love.load()
  lightWorld = LightWorld({
    ambient = {55,55,55},         --the general ambient light in the environment
  })
end

function love.update(dt)
  lightWorld:update(dt)
  lightWorld:setTranslation(x, y, scale)
end

function 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

For more information please check out the 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

  • Preview (Video)
  • polygon shadow calculation Preview
  • circle shadow calculation
  • image shadow calculation Preview
  • shadow blur
  • light color, range, smooth and glow Preview
  • ambient light
  • self shadowing on images with normal maps Preview
  • dynamic glow effect on images and circle/poly objects Preview Preview
  • generate flat or gradient normal maps Preview
  • convert height maps to normal maps Preview
  • generate a normal map directly from the image (usually gives poor results)
  • shadow color and alpha (glass) Preview
  • directional light Preview
  • refractions (moveable) Preview
  • chromatic aberration Preview
  • postshader with many included postshaders, plus easy to extend
  • animations in tandem with normal maps thanks to anim8

License

A License has been included in this project

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.