float quadWidth = display.getWidth() / 8; float quadHeight = display.getWidth() / 8; showReflectionQuad = new Quad( "showReflectionQuad", quadWidth, quadHeight ); showReflectionQuad.setRenderQueueMode( Renderer.QUEUE_ORTHO ); showReflectionQuad.setCullMode( SceneElement.CULL_ALWAYS ); showReflectionQuad.setLightCombineMode( LightState.OFF ); TextureState ts = display.getRenderer().createTextureState(); ts.setTexture( waterEffectRenderPass.getTextureReflect() ); showReflectionQuad.setRenderState( ts ); showReflectionQuad.updateRenderState(); showReflectionQuad.getLocalTranslation().set( quadWidth * 0.6f, quadHeight * 1.0f, 0.0f ); rootNode.attachChild( showReflectionQuad );  showRefractionQuad = new Quad( "showRefractionQuad", quadWidth, quadHeight ); showRefractionQuad.setRenderQueueMode( Renderer.QUEUE_ORTHO ); showRefractionQuad.setCullMode( SceneElement.CULL_ALWAYS ); showRefractionQuad.setLightCombineMode( LightState.OFF ); ts = display.getRenderer().createTextureState(); ts.setTexture( waterEffectRenderPass.getTextureRefract() ); showRefractionQuad.setRenderState( ts ); showRefractionQuad.updateRenderState(); showRefractionQuad.getLocalTranslation().set( quadWidth * 0.6f, quadHeight * 2.1f, 0.0f ); rootNode.attachChild( showRefractionQuad );
	protected void simpleInitGame() {		display.setTitle( "Water Test" );		cam.setFrustumPerspective( 45.0f, (float) display.getWidth() / (float) display.getHeight(), 1f, farPlane );		cam.setLocation( new Vector3f( 100, 50, 100 ) );		//y-up		cam.lookAt( new Vector3f( 0, 0, 0 ), Vector3f.UNIT_Y );		//z-up//		cam.lookAt( new Vector3f( 0, 0, 0 ), Vector3f.UNIT_Z );//		((FirstPersonHandler)input).getMouseLookHandler().setLockAxis( Vector3f.UNIT_Z );		cam.update();		KeyBindingManager.getKeyBindingManager().set( "g", KeyInput.KEY_G );		KeyBindingManager.getKeyBindingManager().set( "lower", KeyInput.KEY_H );		KeyBindingManager.getKeyBindingManager().set( "higher", KeyInput.KEY_Y );		KeyBindingManager.getKeyBindingManager().set( "1", KeyInput.KEY_1 );		KeyBindingManager.getKeyBindingManager().set( "2", KeyInput.KEY_2 );		Text t = new Text( "Text", "Keys: Y/H - raise/lower waterheight" );		t.setRenderQueueMode( Renderer.QUEUE_ORTHO );		t.setLightCombineMode( LightState.OFF );		t.setLocalTranslation( new Vector3f( 0, 20, 0 ) );		fpsNode.attachChild( t );		setupFog();		Node reflectedNode = new Node( "reflectNode" );		buildSkyBox();		reflectedNode.attachChild( skybox );		reflectedNode.attachChild( createObjects() );		rootNode.attachChild( reflectedNode );		waterEffectRenderPass = new WaterRenderPass( cam, 4, false, true );		//setting to default value just to show		waterEffectRenderPass.setWaterPlane( new Plane( new Vector3f( 0.0f, 1.0f, 0.0f ), 0.0f ) );		waterQuad = new Quad( "waterQuad", 1, 1 );		FloatBuffer normBuf = waterQuad.getNormalBuffer( 0 );		normBuf.clear();		normBuf.put( 0 ).put( 1 ).put( 0 );		normBuf.put( 0 ).put( 1 ).put( 0 );		normBuf.put( 0 ).put( 1 ).put( 0 );		normBuf.put( 0 ).put( 1 ).put( 0 );		waterEffectRenderPass.setWaterEffectOnSpatial( waterQuad );		rootNode.attachChild( waterQuad );		waterEffectRenderPass.setReflectedScene( reflectedNode );		waterEffectRenderPass.setSkybox( skybox );		pManager.add( waterEffectRenderPass );		RenderPass rootPass = new RenderPass();		rootPass.add( rootNode );		pManager.add( rootPass );		RenderPass fpsPass = new RenderPass();		fpsPass.add( fpsNode );		pManager.add( fpsPass );		rootNode.setCullMode( Spatial.CULL_NEVER );		rootNode.setRenderQueueMode( Renderer.QUEUE_OPAQUE );		fpsNode.setRenderQueueMode( Renderer.QUEUE_OPAQUE );	}