Returns x if x is between lower and upper, lower if x is less than lower, and upper if x is greater than upper.
Returns x if x is between lower and upper, lower if x is less than lower, and upper if x is greater than upper.
the lower bound
the upper bound
the value to clamp
the clamped value
Returns x if x is between lower and upper, lower if x is less than lower, and upper if x is greater than upper.
Returns x if x is between lower and upper, lower if x is less than lower, and upper if x is greater than upper.
the lower bound
the upper bound
the value to clamp
the clamped value
A shortcut for clamp(0.
A shortcut for clamp(0.0f, 1.0f, x).
the value to clamp
the clamped value
Returns 0 if the value is below the minimum and 1 if the value is above the maximum.
Returns 0 if the value is below the minimum and 1 if the value is above the maximum. Otherwise, it returns a smooth Hermite interpolation between the min and max.
See this Nvidia page for more info.
the minimum value
the maximum value
the value to smoothstep interpolate
the smoothstep-interpolated value
Helpers for performing math.