smoothstep 平滑函数
可以用来做一些 [离散] -> [连续] 的平滑操作。
其函数表示如下:
genType t; /* Or genDType t; */
t = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);
return t * t * (3.0 - 2.0 * t);
smoothstep(0.3, 0.6, x)图像如下:< 0.3 为0; >0.6 为1
smoothstep(0.6, 0.3, x)图像如下: < 0.3 为1; >0.6 为0
最后,欢迎大家一起交流学习:微信:liaosy666 ; QQ:2209115372 。