補間関数
#数学 書き間違い対策 #補完
aからbの間を何割の値で変化させるか、的な計算
イージングとも
参考
http://marupeke296.com/TIPS_No19_interpolation.html
線形補間
エルミート補間
http://www.fundza.com/rman_shaders/smoothstep/index.html
http://totoha.web.fc2.com/Hermite_interpolation-3.pdf
http://www.sic.shibaura-it.ac.jp/~masaomi/suuchi/hokan_hosoku.pdf
https://ja.wikipedia.org/wiki/Smoothstep
https://www.youtube.com/watch?v=vKNHUCDzn54
パーリン先生の補間
ease-in, ease-out
ease-in $ y=x^2
ease-out $ y=x(2-x)
傾きを操作出来ないのが玉に傷
この他のイージング関数はEasing Functions Cheat Sheetで確認できる!
コサイン補間
3次関数補間
シグモイド関数補間
code:hlsl
fixed sigmoid(fixed a, fixed x){ // シグモイド関数補間
fixed e1 = exp(1*a*(2*x-1));
fixed e2 = exp(-1*a);
return 0.5 * (
1 + (
(1-e1) / (1+e1) *
(1+e2) / (1-e2)
)
);
}
なんか見つけた奴
https://gyazo.com/d2fdc5aaf4ad42d122c56aaffea688ce
0と1を確実に通って、良い感じのEaseOutを得られる