Git Product home page Git Product logo

box2dlights's Introduction

Box2DLights

Fork of Box2DLights by Kalle Hämäläinen

This library offers an easy way to add soft dynamic 2d lights and shadows to your game.

Rendering is done with libgdx, but it would be easy to port this to another framework or pure openGL.

FEATURES:

  • NEW: Shaders stored in external files
  • NEW: Updated Demo for both Desktop and Android platforms
  • Arbitrary number of lights
  • Gaussian blurred light maps
  • Point light
  • Cone Light
  • Directional Light
  • Shadows
  • Dynamic/Static/X-Ray Lights
  • Culling
  • Colored ambient light
  • Gamma corrected colors.
  • Handler class to do all the work.
  • Query method for testing is point inside of light/shadow

NOTES: Compiled and tested with libgdx nightlies 2013-06-29

Read the latest Documentation
Download Latest Compiled Library Jars: Box2DLights Library

ScreenShot

box2dlights's People

Contributors

aloecken avatar droidinteractive avatar testpersonal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

box2dlights's Issues

Unable to draw on FrameBuffer

I'm currently working with GLSL shaders in LibGDX. When I draw my stuff onto a FrameBuffer and then drawing the buffer to the screen, all lights (even ambient color) disappear. It seems to be that:

myBuffer.begin();
rayHandler.updateAndRender();
myBuffer.end();

..doesn't work. After some research I found out that the internal FrameBuffer of the RayHandler breaks it.

Cannot use new RayHandler after disposing of a rayhandler

Not sure if this is intended or not...

    rayHandler = new RayHandler(scene.getWorld());
    rayHandler.setCombinedMatrix(lightingCamera.combined);
    rayHandler.setAmbientLight(0.1f);
    new ConeLight(rayHandler, 250, Color.WHITE, 16f, 0f, 0f, 180f, 30f);

works well. Lighting is there, shadows, ambient light, all great.

    rayHandler = new RayHandler(scene.getWorld());
    rayHandler.dispose();
    rayHandler = new RayHandler(scene.getWorld());
    rayHandler.setCombinedMatrix(lightingCamera.combined);
    rayHandler.setAmbientLight(0.1f);
    l = new ConeLight(rayHandler, 250, Color.WHITE, 16f, 0f, 0f, 180f, 30f);

does not work. No lights, no shadow, just my unaffected level.

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.