stk-code_catmod/data/shaders/flip.frag
samuncle 0a1431aed5 Corrected a bug on intel driver
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14604 178a84e3-b1eb-0310-8ba1-8eac791a3b58
2013-12-01 23:46:12 +00:00

28 lines
475 B
GLSL

uniform sampler2D tex;
void main()
{
vec2 texc = gl_TexCoord[0].xy;
texc.y = 1.0 - texc.y;
vec4 col = texture2D(tex, texc);
//col = col / (1 - col);
float inBlack = 0.0;
float inWhite = 137.0;
float inGamma = 0.65;
float outWhite = 255.0;
float outBlack = 0.0;
col.rgb = (pow(((col.rgb * 255.0) - inBlack) / (inWhite - inBlack),
vec3(1.0 / inGamma)) * (outWhite - outBlack) + outBlack) / 255.0;
gl_FragColor = vec4(col.rgb, 1.0);
}