2013-11-30 16:33:06 -05:00
|
|
|
uniform sampler2D tex;
|
2016-08-15 02:46:02 -04:00
|
|
|
uniform float scale;
|
2013-11-30 16:33:06 -05:00
|
|
|
|
2014-01-19 13:31:00 -05:00
|
|
|
out vec4 FragColor;
|
2014-02-28 11:29:05 -05:00
|
|
|
|
2016-06-27 07:11:27 -04:00
|
|
|
#stk_include "utils/getCIEXYZ.frag"
|
|
|
|
#stk_include "utils/getRGBfromCIEXxy.frag"
|
2014-01-12 16:07:14 -05:00
|
|
|
|
2013-11-30 16:33:06 -05:00
|
|
|
void main()
|
|
|
|
{
|
2016-08-15 02:46:02 -04:00
|
|
|
vec2 uv = gl_FragCoord.xy / (512. * scale);
|
2014-06-03 13:56:59 -04:00
|
|
|
vec3 col = texture(tex, uv).xyz;
|
2014-09-23 19:19:37 -04:00
|
|
|
vec3 Yxy = getCIEYxy(col);
|
|
|
|
vec3 WhiteYxy = getCIEYxy(vec3(1.));
|
2013-11-30 16:33:06 -05:00
|
|
|
|
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);
|
2013-11-30 16:33:06 -05:00
|
|
|
}
|