Hello. I’m sure there’s an easy answer for this.
I’m playing around with the SimpleWaterProcessor, but I can’t make it transparent - it just reflects the surrounding scene and doesn’t show the texture on the waterbed beneath the surface. Is SimpleWaterProcessor capable of this?
Here’s how I set it up:
[java]SimpleWaterProcessor waterProcessor = new SimpleWaterProcessor(app.getAssetManager());
waterProcessor.setReflectionScene(worldNode);
Vector3f waterLocation = new Vector3f(0,-3,0);
waterProcessor.setPlane(new Plane(Vector3f.UNIT_Y, waterLocation.dot(Vector3f.UNIT_Y)));
app.getViewPort().addProcessor(waterProcessor);
waterProcessor.setWaterDepth(40);
waterProcessor.setDistortionScale(0.05f);
waterProcessor.setWaveSpeed(0.05f);
waterProcessor.setWaterTransparency(0.05f);
waterProcessor.setLightPosition(new Vector3f(-4.9f, -1.3f, 5.9f));
Geometry water = waterProcessor.createWaterGeometry(1000, 1000);
water.setLocalRotation(new Quaternion().fromAngleAxis(-FastMath.HALF_PI, Vector3f.UNIT_X));
water.setLocalTranslation(-500, -3, 500);
water.setShadowMode(ShadowMode.Receive);
water.setQueueBucket(Bucket.Transparent);
water.setMaterial(waterProcessor.getMaterial());
rootNode.attachChild(water);[/java]