From f73c2b379d5fcc3a09d499b684be343094a8af49 Mon Sep 17 00:00:00 2001 From: Nehon Date: Fri, 17 Apr 2015 16:06:51 +0200 Subject: [PATCH] Fixed water filter's glsl 100 shader --- .../src/main/resources/Common/MatDefs/Water/Water.frag | 6 +----- .../src/main/resources/Common/MatDefs/Water/Water.j3md | 1 + 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/jme3-effects/src/main/resources/Common/MatDefs/Water/Water.frag b/jme3-effects/src/main/resources/Common/MatDefs/Water/Water.frag index 07a4c6429..cb393dbaa 100644 --- a/jme3-effects/src/main/resources/Common/MatDefs/Water/Water.frag +++ b/jme3-effects/src/main/resources/Common/MatDefs/Water/Water.frag @@ -413,10 +413,6 @@ void main(){ // to calculate the derivatives for all these pixels by using step()! // That way we won't get pixels around the edges of the terrain, // Where the derivatives are undefined - if(position.y > level){ - color = color2; - } - - gl_FragColor = vec4(color,1.0); + gl_FragColor = vec4(mix(color, color2, step(level, position.y)), 1.0); } \ No newline at end of file diff --git a/jme3-effects/src/main/resources/Common/MatDefs/Water/Water.j3md b/jme3-effects/src/main/resources/Common/MatDefs/Water/Water.j3md index 2f4b2b39c..2f188934b 100644 --- a/jme3-effects/src/main/resources/Common/MatDefs/Water/Water.j3md +++ b/jme3-effects/src/main/resources/Common/MatDefs/Water/Water.j3md @@ -77,6 +77,7 @@ MaterialDef Advanced Water { FragmentShader GLSL120 : Common/MatDefs/Water/Water.frag WorldParameters { + ViewProjectionMatrixInverse } Defines { ENABLE_RIPPLES : UseRipples