1
0
Fork 0

Fix light shaders

This commit is contained in:
Frederic Bouvier 2012-03-31 21:13:47 +02:00
parent dc3ee9ad6e
commit b2b391b2ef
2 changed files with 2 additions and 3 deletions

View file

@ -24,7 +24,7 @@ void main() {
float depth = texture2D( depth_tex, coords ).r;
vec3 normal;
normal.xy = texture2D( normal_tex, coords ).rg * 2.0 - vec2(1.0,1.0);
normal.z = sqrt( 1 - dot( normal.xy, normal.xy ) );
normal.z = sqrt( 1.0 - dot( normal.xy, normal.xy ) );
vec4 spec_emis = texture2D( spec_emis_tex, coords );
vec3 pos;

View file

@ -28,7 +28,7 @@ void main() {
float depth = texture2D( depth_tex, coords ).r;
vec3 normal;
normal.xy = texture2D( normal_tex, coords ).rg * 2.0 - vec2(1.0,1.0);
normal.z = sqrt( 1 - dot( normal.xy, normal.xy ) );
normal.z = sqrt( 1.0 - dot( normal.xy, normal.xy ) );
vec4 spec_emis = texture2D( spec_emis_tex, coords );
vec3 pos;
@ -64,7 +64,6 @@ void main() {
vec4 Iamb = Ambient * color * att;
vec4 Idiff = Diffuse * color * att * nDotVP;
vec3 Ispec = pow( nDotHV, spec_emis.y ) * spec_emis.x * att * Specular.rgb;
vec3 Ispec = 0.0;
gl_FragColor = vec4(Iamb.rgb + Idiff.rgb + Ispec, 1.0);
}