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?
1 Answer
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.
-
\$\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\$– RothensFeb 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\$– AturSamsFeb 23, 2015 at 8:32