Jump to content

Smoothstep

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Tcpp (talk | contribs) at 13:16, 1 January 2010 (interlanguage link). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Smoothstep is the name given to a specialized interpolation technique present in several independent computer graphics APIs[1][2] and game engines[3]. It is a function that interpolates smoothly between two input values based on a weight which is also provided as an input value to the function.

It is claimed in both the MSDN and OpenGL documentation that the function has been implemented using Hermite interpolation.

An example implementation provided by AMD[4] follows.

float smoothstep (float edge0, float edge1, float x)
{
    // Scale, bias and saturate x to 0..1 range
    x = saturate((x - edge0) / (edge1 - edge0)); 
    // Evaluate polynomial
    return x*x*(3-2*x);
}


References