2021-02-12 23:44:51 +00:00
|
|
|
uniform half4 colorGreen, colorRed;
|
|
|
|
|
2021-04-21 18:27:08 +00:00
|
|
|
half4 main(float2 coords) {
|
2021-02-12 23:44:51 +00:00
|
|
|
float4 value = colorGreen.gggg * 6;
|
|
|
|
int4 exp;
|
|
|
|
float4 result;
|
|
|
|
bool4 ok;
|
|
|
|
|
|
|
|
// 6 equals 0.75 * 2^3.
|
|
|
|
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);
|
|
|
|
result.xyzw = frexp(value.xyzw, exp.xyzw);
|
|
|
|
ok.w = (result.w == 0.75 && exp.w == 3);
|
|
|
|
|
|
|
|
return all(ok) ? colorGreen : colorRed;
|
|
|
|
}
|