MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ smoothstep() [2/2]

template<typename T >
constexpr T MayaFlux::Kinesis::smoothstep ( T  lo,
T  hi,
T  x 
)
constexprnoexcept

GLSL smoothstep: Hermite interpolation in [lo, hi].

Returns 0 when x <= lo, 1 when x >= hi, and a smooth cubic curve in between. Equivalent to GLSL smoothstep(lo, hi, x).

GLM provides this as glm::smoothstep but requires glm/gtx/compatibility.hpp and a vector type. This overload accepts any scalar T.

Definition at line 107 of file Scalar.hpp.

108{
109 const T t = std::clamp((x - lo) / (hi - lo), T { 0 }, T { 1 });
110 return t * t * (T { 3 } - T { 2 } * t);
111}

References smoothstep().

Referenced by smoothstep(), and smoothstep().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: