nuclear@65: uniform sampler2D fbtex; nuclear@72: uniform sampler3D paltex; nuclear@65: nuclear@65: void main() nuclear@65: { nuclear@72: // lookup the render output color for this pixel nuclear@77: vec4 fbcolor = texture2D(fbtex, gl_TexCoord[0].st); nuclear@77: vec3 tc = (fbcolor.xyz * 15.0 + 0.5) / 16.0; nuclear@72: // use that color as an index into the palette nuclear@77: vec3 color = texture3D(paltex, tc).xyz; nuclear@77: // gamma-correction nuclear@78: nuclear@78: gl_FragColor = vec4(color, fbcolor.a); nuclear@78: //gl_FragColor = vec4(pow(color, 1.0 / 2.2), fbcolor.a); nuclear@78: //gl_FragColor = vec4(sqrt(color), fbcolor.a); nuclear@65: }