Browse Source

Fixed artifact on simple water for old intel card thanks to Androlo
http://jmonkeyengine.org/groups/graphics/forum/topic/fixed-problem-in-simple-water/#post-162943

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9145 75d07b2b-3a1a-0410-a2c5-0572b91ccdca

rem..om 13 years ago
parent
commit
512ebfaa1f
1 changed files with 2 additions and 1 deletions
  1. 2 1
      engine/src/core-data/Common/MatDefs/Water/simple_water.frag

+ 2 - 1
engine/src/core-data/Common/MatDefs/Water/simple_water.frag

@@ -102,7 +102,8 @@ void main(void)
     vec4 E=normalize(viewCamDir);
      vec4 vRef = normalize(reflect(-L,vNorm));
      float stemp =max(0.0, dot( vRef,E) );
-     vec4 specular;
+     //initializing to 0 to avoid artifacts on old intel cards
+     vec4 specular = vec4(0.0,0.0,0.0,0.0);
     if(stemp>0.0){
          stemp = pow(stemp, exponent);
          specular = vec4(stemp);