smoothstep
#数学
#GLSL
smoothな
ヘヴィサイドの階段関数
しきい値a, b間の値を、3次
Hermite interpolation
$ -2t^3 + 3t^2
で補間する
一回微分しても連続
code:cpp
float smoothstep(float a, float b, float t) {
float x = saturate((t - a) / (b - a));
return x * x * (3.0 - 2.0 * x);
}
傾きの最大は
$ t = 0.5
のときであり、その値は
$ 1.5
Unity: Mathf.SmoothStep
はこのsmoothstepとはまるで別物なので注意
See also:
linearstep
smootherstep
smooteststep
Desmos
https://gyazo.com/9198446ee1cfe8df5e7919414911e16c
https://www.desmos.com/calculator/ehlqhvpybz