VisualShaderNodeColorOp¶
继承: VisualShaderNode < Resource < RefCounted < Object
在可视着色器图中使用的Color运算符。
描述¶
将operator应用于两个颜色输入。
属性¶
枚举¶
enum Operator: 🔗
Operator OP_SCREEN = 0
使用以下公式产生滤色效果:
result = vec3(1.0) - (vec3(1.0) - a) * (vec3(1.0) - b);
Operator OP_DIFFERENCE = 1
使用以下公式产生差异效果:
result = abs(a - b);
Operator OP_DARKEN = 2
使用以下公式产生变暗效果:
result = min(a, b);
Operator OP_LIGHTEN = 3
使用以下公式产生变亮效果::
result = max(a, b);
Operator OP_OVERLAY = 4
使用以下公式产生覆盖效果:
for (int i = 0; i < 3; i++) {
float base = a[i];
float blend = b[i];
if (base < 0.5) {
result[i] = 2.0 * base * blend;
} else {
result[i] = 1.0 - 2.0 * (1.0 - blend) * (1.0 - base);
}
}
Operator OP_DODGE = 5
使用以下公式产生闪避效果:
result = a / (vec3(1.0) - b);
Operator OP_BURN = 6
使用以下公式产生灼烧效果。
result = vec3(1.0) - (vec3(1.0) - a) / b;
Operator OP_SOFT_LIGHT = 7
使用以下公式产生柔光效果::
for (int i = 0; i < 3; i++) {
float base = a[i];
float blend = b[i];
if (base < 0.5) {
result[i] = base * (blend + 0.5);
} else {
result[i] = 1.0 - (1.0 - base) * (1.0 - (blend - 0.5));
}
}
Operator OP_HARD_LIGHT = 8
使用以下公式产生强光效果:
for (int i = 0; i < 3; i++) {
float base = a[i];
float blend = b[i];
if (base < 0.5) {
result[i] = base * (2.0 * blend);
} else {
result[i] = 1.0 - (1.0 - base) * (1.0 - 2.0 * (blend - 0.5));
}
}
Operator OP_MAX = 9
表示Operator枚举的大小。
属性说明¶
要应用于输入的运算符。有关选项,请参阅Operator。