|
Smoothstep is a scalar interpolation function commonly used in computer graphics〔(Smoothstep at Microsoft Developer Network )〕〔(GLSL Language Specification, Version 1.40 )〕 and video game engines.〔(Unity game engine SmoothStep documentation )〕 The function interpolates smoothly between two input values based on a third one that should be between the first two. The returned value is clamped between 0 and 1. The slope of the smoothstep function tends toward zero at both edges. This makes it easy to create a sequence of transitions using smoothstep to interpolate each segment rather than using a more sophisticated or expensive interpolation technique. As pointed out in MSDN and OpenGL documentation, smoothstep implements cubic Hermite interpolation after doing a clamp: : A C/C++ example implementation provided by AMD〔(ATI R3x0 Pixel Shaders )〕 follows. float smoothstep(float edge0, float edge1, float x) == Variations == Ken Perlin suggests〔(Texturing and Modeling, Third Edition: A Procedural Approach )〕 an improved version of the smoothstep function which has zero 1st and 2nd order derivatives at t=0 and t=1: : C/C++ reference implementation: float smootherstep(float edge0, float edge1, float x) 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Smoothstep」の詳細全文を読む スポンサード リンク
|