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

◆ smoothstep() [2/2]

template<typename T >
constexpr T MayaFlux::Kinesis::smoothstep ( lo,
hi,
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 80 of file Scalar.hpp.

81{
82 const T t = std::clamp((x - lo) / (hi - lo), T { 0 }, T { 1 });
83 return t * t * (T { 3 } - T { 2 } * t);
84}