2
\$\begingroup\$

I have a libGDX project, in which I have a Box2D world, which is currently filled with some boxes as a terrain. I also added a DirectionalLight to the scene for simulating the Sun. I almost have the effect I'd like to achieve, but is there any way to let the light shine through the water more deeply than it does on the surface? enter image description here

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$

You simply need to define the water, the same way you define the skies for lighting purposes. You may or may not need to duplicate the world simulation for lighting if you want water to behave different from solids.

\$\endgroup\$
2
  • \$\begingroup\$ so I create two worlds, and I add all the blocks into the first one, and add all, minus the transparent/semi transparent ones into an other? \$\endgroup\$
    – Rothens
    Feb 23, 2015 at 7:10
  • \$\begingroup\$ That would work. Where the second world is for rendering light. Another option is to extend the code for DirectionalLight to ignore blocks with certain properties. \$\endgroup\$
    – AturSams
    Feb 23, 2015 at 8:32

You must log in to answer this question.

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