stk-code_catmod/data/shaders/bloom.frag

19 lines
415 B
GLSL
Raw Normal View History

uniform sampler2D tex;
out vec4 FragColor;
#stk_include "utils/getCIEXYZ.frag"
#stk_include "utils/getRGBfromCIEXxy.frag"
void main()
{
2016-06-28 15:55:51 -04:00
vec2 uv = gl_FragCoord.xy / 512.;
vec3 col = texture(tex, uv).xyz;
2014-09-23 19:19:37 -04:00
vec3 Yxy = getCIEYxy(col);
vec3 WhiteYxy = getCIEYxy(vec3(1.));
2016-06-28 15:55:51 -04:00
Yxy.x = smoothstep(WhiteYxy.x, WhiteYxy.x * 4., Yxy.x);
2014-09-23 19:19:37 -04:00
2014-10-06 18:00:16 -04:00
FragColor = vec4(max(vec3(0.), getRGBFromCIEXxy(Yxy)), 1.0);
}