istereo

diff sdr/tunnel.p.glsl @ 30:8dd271942543

fixed everything
author John Tsiombikas <nuclear@mutantstargoat.com>
date Thu, 08 Sep 2011 14:52:13 +0300
parents fb4c9641059f
children
line diff
     1.1 --- a/sdr/tunnel.p.glsl	Thu Sep 08 08:31:15 2011 +0300
     1.2 +++ b/sdr/tunnel.p.glsl	Thu Sep 08 14:52:13 2011 +0300
     1.3 @@ -1,5 +1,5 @@
     1.4  #ifdef GL_ES
     1.5 -precision highp float;
     1.6 +precision mediump float;
     1.7  #endif
     1.8  
     1.9  uniform sampler2D tex, tex_norm;
    1.10 @@ -40,13 +40,12 @@
    1.11  	vec3 h = normalize(v + l);
    1.12  	float specular = pow(max(dot(n, h), 0.0), 60.0);
    1.13  
    1.14 -	vec3 amb = vec3(0.02, 0.02, 0.02);
    1.15 +	const vec3 amb = vec3(0.02, 0.02, 0.02);
    1.16  
    1.17  	float att = clamp(1.0 / (0.5 * (ldist * ldist)), 0.0, 1.0);
    1.18  
    1.19  	vec3 dif = tcol * diffuse * att;
    1.20  	vec3 spec = vec3(0.6, 0.6, 0.6) * specular * att;
    1.21  
    1.22 -	//gl_FragColor = 0.5 * tcol + 0.5 * tnorm;//mix(fog_color, tcol, fog);
    1.23  	gl_FragColor = vec4(fog * (amb + dif + spec), 1.0);
    1.24  }