From 5a22c0d9de3303cda986e74a1dfb9af66541ef6d Mon Sep 17 00:00:00 2001 From: "rem..om" Date: Wed, 7 Nov 2012 23:36:37 +0000 Subject: [PATCH] Water reflection/refraction cameras parallel projection is now explicitely set to false. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9974 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../core-effects/com/jme3/water/SimpleWaterProcessor.java | 7 +++++++ engine/src/core-effects/com/jme3/water/WaterFilter.java | 1 + 2 files changed, 8 insertions(+) diff --git a/engine/src/core-effects/com/jme3/water/SimpleWaterProcessor.java b/engine/src/core-effects/com/jme3/water/SimpleWaterProcessor.java index e8eae986a..4a8dd75ae 100644 --- a/engine/src/core-effects/com/jme3/water/SimpleWaterProcessor.java +++ b/engine/src/core-effects/com/jme3/water/SimpleWaterProcessor.java @@ -199,6 +199,7 @@ public class SimpleWaterProcessor implements SceneProcessor { sceneCam.getFrustumRight(), sceneCam.getFrustumTop(), sceneCam.getFrustumBottom()); + refractionCam.setParallelProjection(false); //update reflection cam boolean inv = false; @@ -215,6 +216,7 @@ public class SimpleWaterProcessor implements SceneProcessor { sceneCam.getFrustumRight(), sceneCam.getFrustumTop(), sceneCam.getFrustumBottom()); + reflectionCam.setParallelProjection(false); // tempVec and calcVect are just temporary vector3f objects vect1.set(sceneCam.getLocation()).addLocal(sceneCam.getUp()); float planeDistance = plane.pseudoDistance(vect1); @@ -226,6 +228,11 @@ public class SimpleWaterProcessor implements SceneProcessor { reflectionCam.setAxes(reflectionCam.getLeft().negateLocal(), reflectionCam.getUp(), reflectionCam.getDirection().negateLocal()); } + //we are rendering a sub part of the scene so the camera planeState may never be reseted to 0. +// reflectionCam.setPlaneState(0); +// refractionCam.setPlaneState(0); + + //Rendering reflection and refraction rm.renderViewPort(reflectionView, savedTpf); rm.renderViewPort(refractionView, savedTpf); diff --git a/engine/src/core-effects/com/jme3/water/WaterFilter.java b/engine/src/core-effects/com/jme3/water/WaterFilter.java index b22a2444c..515270c95 100644 --- a/engine/src/core-effects/com/jme3/water/WaterFilter.java +++ b/engine/src/core-effects/com/jme3/water/WaterFilter.java @@ -174,6 +174,7 @@ public class WaterFilter extends Filter { sceneCam.getFrustumRight(), sceneCam.getFrustumTop(), sceneCam.getFrustumBottom()); + reflectionCam.setParallelProjection(false); TempVars vars = TempVars.get();