stk-code_catmod/data/shaders/bloom.frag
hiker d9375c9a43 Revert 65cb55add4 (Make bloom less
pixelated using Intel doc) since it causes crashes on hd3000.
2015-03-16 08:37:59 +11:00

19 lines
403 B
GLSL

uniform sampler2D tex;
out vec4 FragColor;
vec3 getCIEYxy(vec3 rgbColor);
vec3 getRGBFromCIEXxy(vec3 YxyColor);
void main()
{
vec2 uv = gl_FragCoord.xy / 512;
vec3 col = texture(tex, uv).xyz;
vec3 Yxy = getCIEYxy(col);
vec3 WhiteYxy = getCIEYxy(vec3(1.));
Yxy.x = smoothstep(WhiteYxy.x, WhiteYxy.x * 4, Yxy.x);
FragColor = vec4(max(vec3(0.), getRGBFromCIEXxy(Yxy)), 1.0);
}