22 lines
481 B
Plaintext
22 lines
481 B
Plaintext
uniform half4 color;
|
|
|
|
half add(half a, half b) {
|
|
half c = a + b;
|
|
return c;
|
|
}
|
|
|
|
half mul(half a, half b) {
|
|
return a * b;
|
|
}
|
|
|
|
half fused_multiply_add(half a, half b, half c) {
|
|
return add(mul(a, b), c);
|
|
}
|
|
|
|
half4 main(float2 coords) {
|
|
half a = fused_multiply_add(color.x, color.y, color.z);
|
|
half b = fused_multiply_add(color.y, color.z, color.w);
|
|
half c = fused_multiply_add(color.z, color.w, color.x);
|
|
return half4(a, b, mul(c, c), mul(a, mul(b, c)));
|
|
}
|