2013-11-30 16:33:06 -05:00
|
|
|
uniform sampler2D tex;
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
vec2 texc = gl_TexCoord[0].xy;
|
|
|
|
texc.y = 1.0 - texc.y;
|
|
|
|
|
2013-12-01 16:52:07 -05:00
|
|
|
|
|
|
|
vec4 col = texture2D(tex, texc);
|
2013-12-01 17:48:12 -05:00
|
|
|
|
|
|
|
//col = col / (1 - col);
|
2013-12-01 16:52:07 -05:00
|
|
|
|
2013-12-01 17:48:12 -05:00
|
|
|
|
|
|
|
float inBlack = 0.0;
|
|
|
|
float inWhite = 137.0;
|
|
|
|
float inGamma = 0.65;
|
|
|
|
|
2013-12-01 16:52:07 -05:00
|
|
|
|
2013-12-01 17:48:12 -05:00
|
|
|
float outWhite = 255.0;
|
|
|
|
float outBlack = 0.0;
|
|
|
|
|
2013-12-01 16:52:07 -05:00
|
|
|
|
2013-12-01 18:46:12 -05:00
|
|
|
col.rgb = (pow(((col.rgb * 255.0) - inBlack) / (inWhite - inBlack),
|
|
|
|
vec3(1.0 / inGamma)) * (outWhite - outBlack) + outBlack) / 255.0;
|
2013-12-01 17:48:12 -05:00
|
|
|
|
2013-12-01 16:52:07 -05:00
|
|
|
gl_FragColor = vec4(col.rgb, 1.0);
|
2013-11-30 16:33:06 -05:00
|
|
|
}
|