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
3.0
rem..om 13 years ago
parent a64db6fc7b
commit 512ebfaa1f
  1. 3
      engine/src/core-data/Common/MatDefs/Water/simple_water.frag

@ -102,7 +102,8 @@ void main(void)
vec4 E=normalize(viewCamDir); vec4 E=normalize(viewCamDir);
vec4 vRef = normalize(reflect(-L,vNorm)); vec4 vRef = normalize(reflect(-L,vNorm));
float stemp =max(0.0, dot( vRef,E) ); 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){ if(stemp>0.0){
stemp = pow(stemp, exponent); stemp = pow(stemp, exponent);
specular = vec4(stemp); specular = vec4(stemp);

Loading…
Cancel
Save