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-09-08 17:14:14 +00:00
|
|
|
float4 value = float4(2.5, -2.5, 8, -0.125);
|
|
|
|
const float4 expectedWhole = float4(2, -2, 8, 0);
|
|
|
|
const float4 expectedFraction = float4(0.5, -0.5, 0, -0.125);
|
|
|
|
bool4 ok = bool4(false);
|
2021-02-12 23:44:51 +00:00
|
|
|
float4 whole, fraction;
|
|
|
|
|
|
|
|
fraction.x = modf(value.x, whole.x);
|
2021-09-08 17:14:14 +00:00
|
|
|
ok.x = whole.x == expectedWhole.x && fraction.x == expectedFraction.x;
|
2021-02-12 23:44:51 +00:00
|
|
|
fraction.xy = modf(value.xy, whole.xy);
|
2021-09-08 17:14:14 +00:00
|
|
|
ok.y = whole.xy == expectedWhole.xy && fraction.xy == expectedFraction.xy;
|
2021-02-12 23:44:51 +00:00
|
|
|
fraction.xyz = modf(value.xyz, whole.xyz);
|
2021-09-08 17:14:14 +00:00
|
|
|
ok.z = whole.xyz == expectedWhole.xyz && fraction.xyz == expectedFraction.xyz;
|
2021-02-12 23:44:51 +00:00
|
|
|
fraction.xyzw = modf(value.xyzw, whole.xyzw);
|
2021-09-08 17:14:14 +00:00
|
|
|
ok.w = whole.xyzw == expectedWhole.xyzw && fraction.xyzw == expectedFraction.xyzw;
|
2021-02-12 23:44:51 +00:00
|
|
|
|
|
|
|
return all(ok) ? colorGreen : colorRed;
|
|
|
|
}
|