4
\$\begingroup\$

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

\$\endgroup\$
0
\$\begingroup\$

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( ... );    
pointLight.setXray(true);
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.