I’ve been playing around with our company logos and the water stuff and I noticed that every now and then the reflections move off center from the objects they’re representing. Sometimes its even worse than this.
do you have a snip of your setup? is the water offset in height?
Its an edited version of the TestProjectedGrid water test.
projectedGrid = new ProjectedGrid( "ProjectedGrid", cam, 50, 50, 0.05f, new WaterHeightGenerator());
projectedGrid = new ProjectedGrid( "ProjectedGrid", cam, 50, 50, 0.05f, new HeightGenerator() {
public float getHeight( float x, float z, float time ) {
return FastMath.sin(x*0.05f+time*0.250f)+FastMath.cos(z*0.1f+time*1.0f)*1;
}
});
The screen shot was taken using the bottom code, but the top code has the same effect.
This is the whole renderPass setup:
waterEffectRenderPass = new WaterRenderPass( cam, 4, true, true );
waterEffectRenderPass.setClipBias( 0.5f );
waterEffectRenderPass.setWaterMaxAmplitude( 5.0f );
waterEffectRenderPass.setWaterPlane( new Plane( new Vector3f( 0.0f, 1.0f, 0.0f ), 0.0f ) );
projectedGrid = new ProjectedGrid( "ProjectedGrid", cam, 50, 50, 0.05f, new WaterHeightGenerator());
waterEffectRenderPass.setWaterEffectOnSpatial( projectedGrid );
rootNode.attachChild( projectedGrid );
Nothing else has changed except the reflectionNodes.
Ill post the entire TestClass if you want it.