2020-12-09 21:19:37 +00:00
|
|
|
|
|
|
|
out vec4 sk_FragColor;
|
2021-02-12 23:44:51 +00:00
|
|
|
uniform vec4 colorGreen;
|
|
|
|
uniform vec4 colorRed;
|
|
|
|
vec4 main() {
|
|
|
|
vec4 value = colorGreen.yyyy * 6.0;
|
|
|
|
ivec4 exp;
|
|
|
|
vec4 result;
|
|
|
|
bvec4 ok;
|
|
|
|
result.x = frexp(value.x, exp.x);
|
|
|
|
ok.x = result.x == 0.75 && exp.x == 3;
|
|
|
|
result.xy = frexp(value.xy, exp.xy);
|
|
|
|
ok.y = result.y == 0.75 && exp.y == 3;
|
|
|
|
result.xyz = frexp(value.xyz, exp.xyz);
|
|
|
|
ok.z = result.z == 0.75 && exp.z == 3;
|
2021-02-19 19:09:38 +00:00
|
|
|
result = frexp(value, exp);
|
2021-02-12 23:44:51 +00:00
|
|
|
ok.w = result.w == 0.75 && exp.w == 3;
|
|
|
|
return all(ok) ? colorGreen : colorRed;
|
2020-12-09 21:19:37 +00:00
|
|
|
}
|