Soooo…
I had to take an extended break from working on my game. After multiple bug fixes (mostly to do with UI implementation), I finally got around to making use of that mesh deformation shader to produce a simple and decent looking water effect.
Here are the initial results… using Ripple and Warble together along the Y axis.
http://youtu.be/sgwzqA5-NJs
The settings are as follows:
[java]
Texture tex_Water = assetManager.loadTexture("Textures/Core/Water/Water.png");
tex_Water.setMinFilter(MinFilter.BilinearNoMipMaps);
tex_Water.setMagFilter(MagFilter.Bilinear);
tex_Water.setWrap(WrapMode.Repeat);
mat_ZoneWater = new Material(assetManager, "MatDefs/Displace.j3md");
mat_ZoneWater.setFloat("Shininess", 1f);
mat_ZoneWater.setTexture("DiffuseMap", tex_Water);
mat_ZoneWater.setColor("Ambient", ColorRGBA.White);
mat_ZoneWater.setColor("Diffuse", ColorRGBA.White);
mat_ZoneWater.getAdditionalRenderState().setFaceCullMode(FaceCullMode.Off);
mat_ZoneWater.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
mat_ZoneWater.setBoolean("DeformY_Ripple", true);
mat_ZoneWater.setBoolean("DeformY_Warble", true);
mat_ZoneWater.setInt("DirY", 0);
mat_ZoneWater.setFloat("SpeedY", 3f);
mat_ZoneWater.setFloat("SizeY", 12f);
mat_ZoneWater.setFloat("DepthY", .05f);
[/java]
You'll have to adjust the Speed, Size & Depth depending on the scale of your models... but overall, since the entire effect is pushed off to GPU, the end results are nice.