Clamp

The clamp function (clamp) restricts a number to a specified range between a minimum and maximum value. The minimum and maximum values are automatically swapped if they are reversed.

With vec2 inputs, this applies separately to the X and Y components.

Interface

Inputs

ParameterDetailsPossible Types
Value

The number to be clamped, which is restricted to the range between the minimum and maximum values.

Primary Input

String[]
String
Vec2[]
Vec2
f32[]
f32
f64[]
f64
u32[]
u32
Min

The left (smaller) side of the range. The output is never less than this number.

Default: 0

String[]
String
Vec2[]
Vec2
f32[]
f32
f64[]
f64
u32[]
u32
Max

The right (greater) side of the range. The output is never greater than this number.

Default: 1

String[]
String
Vec2[]
Vec2
f32[]
f32
f64[]
f64
u32[]
u32

Outputs

ProductDetailsPossible Types
Result

The value produced by the node operation.

Primary Output

f64
f64[]
f32
f32[]
u32
u32[]
String
String[]
Vec2
Vec2[]