/** * Sets the size of the reflection map * default is 512, the higher, the better quality, but the slower the effect. * @param reflectionMapSize */ public void setReflectionMapSize(int reflectionMapSize) { this.reflectionMapSize = reflectionMapSize; //if reflection pass is already initialized we must update it if(reflectionPass != null){ reflectionPass.init(renderManager.getRenderer(), reflectionMapSize, reflectionMapSize, Format.RGBA8, Format.Depth); reflectionCam.resize(reflectionMapSize, reflectionMapSize, true); reflectionProcessor.setReflectionBuffer(reflectionPass.getRenderFrameBuffer()); material.setTexture("ReflectionMap", reflectionPass.getRenderedTexture()); } }
/** * Sets the height of the water plane * default is 0.0 * @param waterHeight */ public void setWaterHeight(float waterHeight) { this.waterHeight = waterHeight; this.plane = new Plane(Vector3f.UNIT_Y, waterHeight); if (material != null) { material.setFloat("WaterHeight", waterHeight); } if (reflectionProcessor != null) { reflectionProcessor.setReflectionClipPlane(plane); } }
reflectionView.setOutputFrameBuffer(reflectionPass.getRenderFrameBuffer()); plane = new Plane(Vector3f.UNIT_Y, new Vector3f(0, waterHeight, 0).dot(Vector3f.UNIT_Y)); reflectionProcessor = new ReflectionProcessor(reflectionCam, reflectionPass.getRenderFrameBuffer(), plane); reflectionProcessor.setReflectionClipPlane(plane); reflectionView.addProcessor(reflectionProcessor);
reflectionView.addProcessor(new ReflectionProcessor(reflectionCam, reflectionBuffer, reflectionClipPlane));
reflectionView.setOutputFrameBuffer(reflectionPass.getRenderFrameBuffer()); plane = new Plane(Vector3f.UNIT_Y, new Vector3f(0, waterHeight, 0).dot(Vector3f.UNIT_Y)); reflectionProcessor = new ReflectionProcessor(reflectionCam, reflectionPass.getRenderFrameBuffer(), plane); reflectionProcessor.setReflectionClipPlane(plane); reflectionView.addProcessor(reflectionProcessor);
reflectionView.addProcessor(new ReflectionProcessor(reflectionCam, reflectionBuffer, reflectionClipPlane));
reflectionView.setOutputFrameBuffer(reflectionPass.getRenderFrameBuffer()); plane = new Plane(Vector3f.UNIT_Y, new Vector3f(0, waterHeight, 0).dot(Vector3f.UNIT_Y)); reflectionProcessor = new ReflectionProcessor(reflectionCam, reflectionPass.getRenderFrameBuffer(), plane); reflectionProcessor.setReflectionClipPlane(plane); reflectionView.addProcessor(reflectionProcessor);
reflectionView.addProcessor(new ReflectionProcessor(reflectionCam, reflectionBuffer, reflectionClipPlane));
/** * Sets the size of the reflection map * default is 512, the higher, the better quality, but the slower the effect. * @param reflectionMapSize */ public void setReflectionMapSize(int reflectionMapSize) { this.reflectionMapSize = reflectionMapSize; //if reflection pass is already initialized we must update it if(reflectionPass != null){ reflectionPass.init(renderManager.getRenderer(), reflectionMapSize, reflectionMapSize, Format.RGBA8, Format.Depth); reflectionCam.resize(reflectionMapSize, reflectionMapSize, true); reflectionProcessor.setReflectionBuffer(reflectionPass.getRenderFrameBuffer()); material.setTexture("ReflectionMap", reflectionPass.getRenderedTexture()); } }
/** * Sets the height of the water plane * default is 0.0 * @param waterHeight */ public void setWaterHeight(float waterHeight) { this.waterHeight = waterHeight; this.plane = new Plane(Vector3f.UNIT_Y, waterHeight); if (material != null) { material.setFloat("WaterHeight", waterHeight); } if (reflectionProcessor != null) { reflectionProcessor.setReflectionClipPlane(plane); } }
reflectionView.addProcessor(new ReflectionProcessor(reflectionCam, reflectionBuffer, reflectionClipPlane));
/** * Sets the size of the reflection map * default is 512, the higher, the better quality, but the slower the effect. * @param reflectionMapSize */ public void setReflectionMapSize(int reflectionMapSize) { this.reflectionMapSize = reflectionMapSize; //if reflection pass is already initialized we must update it if(reflectionPass != null){ reflectionPass.init(renderManager.getRenderer(), reflectionMapSize, reflectionMapSize, Format.RGBA8, Format.Depth); reflectionCam.resize(reflectionMapSize, reflectionMapSize, true); reflectionProcessor.setReflectionBuffer(reflectionPass.getRenderFrameBuffer()); material.setTexture("ReflectionMap", reflectionPass.getRenderedTexture()); } }
/** * Sets the height of the water plane * default is 0.0 * @param waterHeight */ public void setWaterHeight(float waterHeight) { this.waterHeight = waterHeight; this.plane = new Plane(Vector3f.UNIT_Y, waterHeight); if (material != null) { material.setFloat("WaterHeight", waterHeight); } if (reflectionProcessor != null) { reflectionProcessor.setReflectionClipPlane(plane); } }
reflectionView.setOutputFrameBuffer(reflectionPass.getRenderFrameBuffer()); plane = new Plane(Vector3f.UNIT_Y, new Vector3f(0, waterHeight, 0).dot(Vector3f.UNIT_Y)); reflectionProcessor = new ReflectionProcessor(reflectionCam, reflectionPass.getRenderFrameBuffer(), plane); reflectionView.addProcessor(reflectionProcessor);
/** * Sets the size of the reflection map * default is 512, the higher, the better quality, but the slower the effect. * @param reflectionMapSize */ public void setReflectionMapSize(int reflectionMapSize) { this.reflectionMapSize = reflectionMapSize; //if reflection pass is already initialized we must update it if(reflectionPass != null){ reflectionPass.init(renderManager.getRenderer(), reflectionMapSize, reflectionMapSize, Format.RGBA8, Format.Depth); reflectionCam.resize(reflectionMapSize, reflectionMapSize, true); reflectionProcessor.setReflectionBuffer(reflectionPass.getRenderFrameBuffer()); material.setTexture("ReflectionMap", reflectionPass.getRenderedTexture()); } }
ray.setDirection(sceneCam.getDirection()); plane = new Plane(Vector3f.UNIT_Y, new Vector3f(0, waterHeight, 0).dot(Vector3f.UNIT_Y)); reflectionProcessor.setReflectionClipPlane(plane); boolean inv = false; if (!ray.intersectsWherePlane(plane, targetLocation)) {