I have a box2D world made of tiles. I use a custom DirectionalLight for light up the scene from above (It shines through transparent blocks [eg.: the water] more deeply). The problem is (as expected), as soon as I build a bridge-like thing in the air, I'll get shadows underneath. What I'd like to achieve, is to get light in the places where there aren't any blocks (i.e. neither in the foreground nor in the background).

Should I completely forget the DirectionalLight, or is there any method to easily "post-fix" these shadowed areas?

The problem


1 Answer 1


I'm just starting out with lighting myself, but one of these two solutions might help you.

set an ambient light to brighten up the world:

rayHandler = new RayHandler(world);
rayHandler.setAmbientLight(new Color(.1f, .1f, .1f, .5f));

or allow the light to ignore bodies:

pointLight = new PointLight( ... );    

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .