Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
VisualShaderNodeFloatOp¶
继承: VisualShaderNode < Resource < RefCounted < Object
浮点数标量运算符,在可视化着色器图中使用。
描述¶
将 operator 应用于两个浮点数输入:a
和 b
。
属性¶
|
枚举¶
enum Operator:
Operator OP_ADD = 0
使用 a + b
将两个数字相加。
Operator OP_SUB = 1
使用 a - b
将两个数字相减。
Operator OP_MUL = 2
使用 a * b
将两个数字相乘。
Operator OP_DIV = 3
使用 a / b
将两个数字相除。
Operator OP_MOD = 4
计算两个数的余数。在 Godot 着色器语言中,会被翻译为 mod(a, b)
。
Operator OP_POW = 5
将 a
提高到 b
次幂。在 Godot 着色器语言中,会被翻译为 pow(a, b)
。
Operator OP_MAX = 6
返回两个数中的较大者。在 Godot 着色器语言中,会被翻译为 max(a, b)
。
Operator OP_MIN = 7
返回两个数中的较小者。在 Godot 着色器语言中,会被翻译为 min(a, b)
。
Operator OP_ATAN2 = 8
返回参数的反正切值。在 Godot 着色器语言中,会被翻译为 atan(a, b)
。
Operator OP_STEP = 9
通过将 b
(x)与 a
(edge)进行比较来生成 step 函数。如果 x
小于 edge
则返回 0.0,否则返回 1.0。翻译为 Godot 着色器语言中的 step(a, b)
。
Operator OP_ENUM_SIZE = 10
代表 Operator 枚举的大小。
属性说明¶
Operator operator = 0
要应用于输入的运算符。参阅 Operator 的选项。