Beautifully designed 3D landscapes invite the player to explore and interact. You couldn't hold it against a player if he or she tried to take a closer look at your water. Maybe a body of water is an important element in your game. Maybe some parts of the game story are even set underwater. For these cases, we need to pull out all the stops and show off what the engine is capable of, by using the com.jme3.water.WaterFilter
class.
Make a copy of
WaterSimple.java
and name the classWaterTerrainSky.java
. Remember to also refactor the first line of themain()
method to the following:WaterTerrainSky app = new WaterTerrainSky();
Keep the class field for the node that groups the reflected scene.
private Node reflectedScene;
Keep the class field for the light direction.
private Vector3f lightDir = new Vector3f (-2.9f, -1.2f, -5.8f);
Keep the
DirectionalLight
insimpleInitApp()
.Keep the
reflectedScene
node and attach it to therootNode
.reflectedScene = new Node...