Add color correction

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14603 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
samuncle 2013-12-01 22:48:12 +00:00
parent ad0fd41d52
commit 9fdfb27a67

View File

@ -7,11 +7,21 @@ void main()
vec4 col = texture2D(tex, texc);
//col = col / (1 - col);
//col = col * 256;
//col = (1 - col);
float inBlack = 0.0;
float inWhite = 137.0;
float inGamma = 0.65;
col = col / (1 - col);
float outWhite = 255.0;
float outBlack = 0.0;
col = (pow(((col * 255.0) - inBlack) / (inWhite - inBlack),
(1.0 / inGamma)) * (outWhite - outBlack) + outBlack) / 255.0;
gl_FragColor = vec4(col.rgb, 1.0);
}