dungeon_crawler

diff prototype/sdr/mrt.p.glsl @ 78:12a1dcfe91fa

gamma correct rendering
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 26 Oct 2012 21:22:14 +0300
parents aa86119e3295
children 110b2af4b9d8
line diff
     1.1 --- a/prototype/sdr/mrt.p.glsl	Fri Oct 26 03:03:52 2012 +0300
     1.2 +++ b/prototype/sdr/mrt.p.glsl	Fri Oct 26 21:22:14 2012 +0300
     1.3 @@ -29,8 +29,10 @@
     1.4  
     1.5  	float fog = clamp((fog_end + pos.z) / (fog_end - fog_start), 0.0, 1.0);
     1.6  
     1.7 -	vec4 texel = texture2D(tex_dif, gl_TexCoord[0].st);
     1.8 -	vec3 diffuse = fog * (gl_FrontMaterial.diffuse * texel).xyz;
     1.9 +	vec3 texel_srgb = texture2D(tex_dif, gl_TexCoord[0].st).xyz;
    1.10 +	vec3 texel = pow(texel_srgb.xyz, 2.2);
    1.11 +
    1.12 +	vec3 diffuse = fog * (gl_FrontMaterial.diffuse.xyz * texel);
    1.13  	vec3 spec = fog * gl_FrontMaterial.specular.xyz;
    1.14  	float sstr = (spec.x + spec.y + spec.z) / 3.0;
    1.15