Interpolation functions allow us to calculate a transition between discreet points. They are used in noise development. Here are some common types.

**Smooth interpolation of a linear input from 0.0 to 1.0**

This is a very common interpolation function. It calculates a smooth transition from 0.0 to 1.0 as the input increases linearly from 0.0 to 1.0. By smooth I mean the gradient is 0.0 at 0.0, 0.0 at 1.0 and positive in between. An example is the GLSL function SmoothStep().

Ken Perlin uses a cubic hermite curve in his original classic noise. It is of the form *f(x) = 3x^2-2x^3*. A problem is that the 2nd derivative is non-zero at 0.0 and 1.0. This can result in a sharp transition when the noise is used to calculate a normal for shading. Ken solved the problem with a quintic hermite curve of the *form f(x) = 6x^5-15x^4+10x^3*. This new function has both 1st and 2nd derivatives of 0.0 at 0.0 and 1.0. More details can be found in his paper. http://mrl.nyu.edu/~perlin/paper445.pdf

The cubic curve is said to be 1st derivative continuous ( C1 for short ). The quintic curve is said to be 1st and 2nd derivative continuous ( C2 for short ).

Here are 4 implementations of this interpolation function. The first two are the previously mentioned cubic and quintic curves. The third is a more efficient C2 interpolation function which contains 1 less multiply than Perlin’s quintic curve. The forth is a C3 interpolation function. Their graph can be seen here.

#####
//
// Interpolation functions
// ( smoothly increase from 0.0 to 1.0 as x increases linearly from 0.0 to 1.0 )
//
// Cubic Hermine Curve. Same as SmoothStep(). As used by Perlin in Original Noise.
// 3x^2-2x^3
float Interpolation_C1( float x ) { return x * x * (3.0 - 2.0 * x); }
// Quintic Hermite Curve. As used by Perlin in Improved Noise. http://mrl.nyu.edu/~perlin/paper445.pdf
// 6x^5-15x^4+10x^3
float Interpolation_C2( float x ) { return x * x * x * (x * (x * 6.0 - 15.0) + 10.0); }
// Faster than Perlin Quintic. Not quite as good shape.
// 7x^3-7x^4+x^7
float Interpolation_C2_Fast( float x ) { float x3 = x*x*x; return ( 7.0 + ( x3 - 7.0 ) * x ) * x3; }
// C3 Interpolation function. If anyone ever needs it... : )
// 25x^4-48x^5+25x^6-x^10
float Interpolation_C3( float x ) { float xsq = x*x; float xsqsq = xsq*xsq; return xsqsq * ( 25.0 - 48.0 * x + xsq * ( 25.0 - xsqsq ) ); }

**Smooth falloff of a squared input from 0.0 to 1.0**

A smooth falloff function is a function which decreases from 1.0 to 0.0 as its input increases from 0.0 to 1.0. To say that it operates on x-squared means that it accepts a squared input rather than a linear one. They can be used to efficiently fade out from a point due to the avoidance of a sqrt() call.

Listed here are two which are commonly used. A graph of the functions can be seen here. Included in the comments are some smooth interpolating functions also defined in x-squared. Their graph can be seen here.

Pingback: Hermite Noise | briansharpe