waterShader.setUniform( "cameraPos", cam.getLocation().x, cam.getLocation().y, cam.getLocation().z );
	public void doRender( Renderer r ) {		normalTranslation += speedReflection * tpf;		refractionTranslation += speedRefraction * tpf;		float camWaterDist = waterPlane.pseudoDistance( cam.getLocation() );		aboveWater = camWaterDist >= 0;		if( isSupported() ) {			waterShader.clearUniforms();			waterShader.setUniform( "tangent", tangent.x, tangent.y, tangent.z );			waterShader.setUniform( "binormal", binormal.x, binormal.y, binormal.z );			waterShader.setUniform( "normalMap", 0 );			waterShader.setUniform( "reflection", 1 );			waterShader.setUniform( "dudvMap", 2 );			if( useRefraction ) {				waterShader.setUniform( "refraction", 3 );				waterShader.setUniform( "depthMap", 4 );			}			waterShader.setUniform( "waterColor", waterColorStart.r, waterColorStart.g, waterColorStart.b, waterColorStart.a );			waterShader.setUniform( "waterColorEnd", waterColorEnd.r, waterColorEnd.g, waterColorEnd.b, waterColorEnd.a );			waterShader.setUniform( "cameraPos", cam.getLocation().x, cam.getLocation().y, cam.getLocation().z );			waterShader.setUniform( "normalTranslation", normalTranslation );			waterShader.setUniform( "refractionTranslation", refractionTranslation );			waterShader.setUniform( "abovewater", aboveWater ? 1 : 0 );			if( useProjectedShader ) {				if( useRefraction ) {					waterShader.setUniform( "foamMap", 5 );				}				else {					waterShader.setUniform( "foamMap", 3 );				}				waterShader.setUniform( "waterHeight", waterPlane.getConstant() );				waterShader.setUniform( "amplitude", waterMaxAmplitude );				waterShader.setUniform( "heightFalloffStart", heightFalloffStart );				waterShader.setUniform( "heightFalloffSpeed", heightFalloffSpeed );			}			waterShader.apply();			float heightTotal = clipBias + waterMaxAmplitude - waterPlane.getConstant();			Vector3f normal = waterPlane.getNormal();			clipState.setClipPlaneEquation( ClipState.CLIP_PLANE0, normal.x, normal.y, normal.z, heightTotal );			clipState.setEnabled( true );			renderReflection();			clipState.setClipPlaneEquation( ClipState.CLIP_PLANE0, -normal.x, -normal.y, -normal.z, -heightTotal );			if( useRefraction && aboveWater ) {				renderRefraction();			}			clipState.setEnabled( false );		}		else {			ts.getTexture().setTranslation( new Vector3f( 0, normalTranslation, 0 ) );		}	}