Global Information Lookup Global Information

Smoothstep information


A plot of the smoothstep(x) and smootherstep(x) functions, using 0 as the left edge and 1 as the right edge

Smoothstep is a family of sigmoid-like interpolation and clamping functions commonly used in computer graphics,[1][2] video game engines,[3] and machine learning.[4]

The function depends on three parameters, the input x, the "left edge" and the "right edge", with the left edge being assumed smaller than the right edge. The function receives a real number x as an argument and returns 0 if x is less than or equal to the left edge, 1 if x is greater than or equal to the right edge, and smoothly interpolates, using a Hermite polynomial, between 0 and 1 otherwise. The gradient of the smoothstep function is zero at both edges. This is convenient for creating a sequence of transitions using smoothstep to interpolate each segment as an alternative to using more sophisticated or expensive interpolation techniques.

In HLSL and GLSL, smoothstep implements the , the cubic Hermite interpolation after clamping:

Assuming that the left edge is 0, the right edge is 1, with the transition between edges taking place where 0 ≤ x ≤ 1.

A modified C/C++ example implementation provided by AMD[5] follows.

float smoothstep (float edge0, float edge1, float x) {
   // Scale, and clamp x to 0..1 range
   x = clamp((x - edge0) / (edge1 - edge0));

   return x * x * (3.0f - 2.0f * x);
}

float clamp(float x, float lowerlimit = 0.0f, float upperlimit = 1.0f) {
  if (x < lowerlimit) return lowerlimit;
  if (x > upperlimit) return upperlimit;
  return x;
}

The general form for smoothstep, again assuming the left edge is 0 and right edge is 1, is

is identical to the clamping function:

The characteristic S-shaped sigmoid curve is obtained with only for integers n ≥ 1. The order of the polynomial in the general smoothstep is 2n + 1. With n = 1, the slopes or first derivatives of the smoothstep are equal to zero at the left and right edge (x = 0 and x = 1), where the curve is appended to the constant or saturated levels. With higher integer n, the second and higher derivatives are zero at the edges, making the polynomial functions as flat as possible and the splice to the limit values of 0 or 1 more seamless.

  1. ^ Smoothstep at Microsoft Developer Network.
  2. ^ GLSL Language Specification, Version 1.40.
  3. ^ Unity game engine SmoothStep documentation.
  4. ^ Hazimeh, Hussein; Ponomareva, Natalia; Mol, Petros; Tan, Zhenyu; Mazumder, Rahul (2020). The Tree Ensemble Layer: Differentiability meets Conditional Computation (PDF). International Conference on Machine Learning. PMLR.
  5. ^ Natalya Tatarchuk (2003). "Advanced Real-Time Shader Techniques". AMD. p. 94. Retrieved 2022-04-16.

and 5 Related for: Smoothstep information

Request time (Page generated in 0.5088 seconds.)

Smoothstep

Last Update:

Smoothstep is a family of sigmoid-like interpolation and clamping functions commonly used in computer graphics, video game engines, and machine learning...

Word Count : 2446

Perlin noise

Last Update:

node 1 is f ( x ) = a 0 + smoothstep ⁡ ( x ) ⋅ ( a 1 − a 0 ) for  0 ≤ x ≤ 1 {\displaystyle f(x)=a_{0}+\operatorname {smoothstep} (x)\cdot (a_{1}-a_{0})\quad...

Word Count : 2188

Oculus Quill

Last Update:

Quill by Smoothstep Developer(s) Smoothstep Initial release November 29, 2016 Operating system Windows 10 or later Available in English Type 3D computer...

Word Count : 283

Sigmoid function

Last Update:

{\displaystyle f(x)=\left(1+e^{-x}\right)^{-\alpha },\quad \alpha >0} Smoothstep function f ( x ) = { ( ∫ 0 1 ( 1 − u 2 ) N d u ) − 1 ∫ 0 x ( 1 − u 2 )...

Word Count : 1688

OpenGL Shading Language

Last Update:

that are provided and are commonly used for graphics purposes are: mix, smoothstep, normalize, inversesqrt, clamp, length, distance, dot, cross, reflect...

Word Count : 1329

PDF Search Engine © AllGlobal.net