dungeon_crawler
view 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 source
1 uniform sampler2D fbtex;
2 uniform sampler3D paltex;
4 void main()
5 {
6 // lookup the render output color for this pixel
7 vec4 fbcolor = texture2D(fbtex, gl_TexCoord[0].st);
8 vec3 tc = (fbcolor.xyz * 15.0 + 0.5) / 16.0;
9 // use that color as an index into the palette
10 vec3 color = texture3D(paltex, tc).xyz;
11 // gamma-correction
12 gl_FragColor = vec4(pow(color, 1.0 / 2.2), fbcolor.a);
13 }