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.

VisualShaderNodeFloatOp

繼承: VisualShaderNode < Resource < RefCounted < Object

浮點數標量運算子,在視覺化著色器圖中使用。

說明

operator 套用於兩個浮點數輸入:ab

屬性

Operator

operator

0


列舉

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 🔗

An operator to be applied to the inputs.