• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2out vec4 sk_FragColor;
3uniform vec4 colorGreen;
4uniform vec4 colorRed;
5vec4 main() {
6    vec4 value = colorGreen.yyyy * 6.0;
7    ivec4 exp;
8    vec4 result;
9    bvec4 ok;
10    result.x = frexp(value.x, exp.x);
11    ok.x = result.x == 0.75 && exp.x == 3;
12    result.xy = frexp(value.xy, exp.xy);
13    ok.y = result.y == 0.75 && exp.y == 3;
14    result.xyz = frexp(value.xyz, exp.xyz);
15    ok.z = result.z == 0.75 && exp.z == 3;
16    result = frexp(value, exp);
17    ok.w = result.w == 0.75 && exp.w == 3;
18    return all(ok) ? colorGreen : colorRed;
19}
20