Hi,
My idea is to make a terrain map with grid on it, with water effect.
Here is the sample code I’m using to make water and grid:
[java]
_fpp = new FilterPostProcessor(assetManager);
_water = new WaterFilter(rootNode, _lightDir);
_water.setWaterHeight(_initialWaterHeight);
_water.setWaterColor(ColorRGBA.Blue);
_water.setDeepWaterColor(ColorRGBA.Blue);
_water.setMaxAmplitude(0.01f);
_water.setNormalScale(0.01f);
_fpp.addFilter(_water);
_fpp.setNumSamples(4);
viewPort.addProcessor(_fpp);
Geometry g = new Geometry("wireframe grid", new Grid(500, 500, 2f) );
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat.getAdditionalRenderState().setWireframe(true);
mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha);
mat.getAdditionalRenderState().setDepthTest(false);
ColorRGBA c = ColorRGBA.Gray.clone();
c.a = 0.5f;
mat.setColor("Color", c);
g.setMaterial(mat);
g.setQueueBucket(Bucket.Translucent);
g.setLocalTranslation(0, -3 + 0.0001f, 0);
rootNode.attachChild(g);
[/java]
Everything looks nice, but on water surface i found some unwanted ‘effects’ like lines, etc.
http://s17.postimg.org/xdndghfbj/wireframe.png
How to get rid of them? How to tell the water to completely ignore my grid? Is there something more than Bucket.Translucent I should use?