perform Hermite interpolation between two values
float smoothstep(float edge0, float edge1, float x)
vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x)
vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x)
vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x)
vec2 smoothstep(float edge0, float edge1, vec2 x)
vec3 smoothstep(float edge0, float edge1, vec3 x)
vec4 smoothstep(float edge0, float edge1, vec4 x)
edge0
: Specifies the value of the lower edge of the Hermite function.edge1
: Specifies the value of the upper edge of the Hermite function.x
: Specifies the source value for interpolation.smoothstep
performs smooth Hermite interpolation between 0 and 1 when edge0
< x
< edge1
. This is useful in cases where a threshold function with a smooth transition is desired. smoothstep
is equivalent to:
smoothstep
returns 0.0 if x
≤ edge0
and 1.0 if x
≥ edge1
.
Results are undefined if edge0
≥ edge1
.