Name Edit

smoothstep - interpolate smoothly between two input values based on a third

Synopsis Edit

vector1 smoothstep(vector1 a, vector1 b, vector1 x);
vector2 smoothstep(vector2 a, vector2 b, vector2 x);
vector3 smoothstep(vector3 a, vector3 b, vector3 x);
vector4 smoothstep(vector4 a, vector4 b, vector4 x);

Parameters Edit

Scalar or vector minimum reference value(s).
Scalar or vector minimum reference value(s).
Scalar or vector.

Description Edit

Interpolates smoothly from 0 to 1 based on x compared to a and b.

1) Returns 0 if x < a < b or x > a > b
1) Returns 1 if x < b < a or x > b > a
3) Returns a value in the range [0,1] for the domain [a,b].

The slope of smoothstep(a,b,a) and smoothstep(a,b,b) is zero.

For vectors, the returned vector contains the smooth interpolation of each element of the vector x.