dungeon_crawler

diff prototype/sdr/post.p.glsl @ 77:d89b403f630b

added gamma correction (without dialing the lighting down yet) fixed the incorrect PointLight sphere radius
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 26 Oct 2012 03:03:52 +0300
parents f379c00eb07f
children 12a1dcfe91fa
line diff
     1.1 --- a/prototype/sdr/post.p.glsl	Tue Oct 23 14:57:08 2012 +0300
     1.2 +++ b/prototype/sdr/post.p.glsl	Fri Oct 26 03:03:52 2012 +0300
     1.3 @@ -4,8 +4,10 @@
     1.4  void main()
     1.5  {
     1.6  	// lookup the render output color for this pixel
     1.7 -	vec4 color = texture2D(fbtex, gl_TexCoord[0].st);
     1.8 -	vec3 tc = (color.xyz * 15.0 + 0.5) / 16.0;
     1.9 +	vec4 fbcolor = texture2D(fbtex, gl_TexCoord[0].st);
    1.10 +	vec3 tc = (fbcolor.xyz * 15.0 + 0.5) / 16.0;
    1.11  	// use that color as an index into the palette
    1.12 -	gl_FragColor = vec4(texture3D(paltex, tc).xyz, color.a);
    1.13 +	vec3 color = texture3D(paltex, tc).xyz;
    1.14 +	// gamma-correction
    1.15 +	gl_FragColor = vec4(pow(color, 1.0 / 2.2), fbcolor.a);
    1.16  }