1
$\begingroup$

When scaling an image with Bicubic Interpolation, the Cubic Hermite spline interpolation is used. smoothstep is one of the four basis/blend functions of this kind of interpolation.

$$ f(x) = 3x^2 - 2x^3 $$

I've seen a trick used in quite a few places in Computer Graphics. Say something is interpolated linearly

$$ L(t) = (1-t)A + t(B - A) $$

What people often do to make it interesting is remap the interpolation parameter $t$ with smoothstep and then lerp

$$ u = smoothstep(t) \\ L(u) = (1-u)A + u(B - A) $$

The result (interpolant) is still linear but the speed at which the output varies isn't constant: starts slow and ends up slow, speeds up in the middle. When interpolating a value, by remapping the interpolation parameter, an illusion of non-linear output is achived since the linearly increasing parameter was looped through smoothstep (non-linear).

Some examples

I'm trying to better understand this trick. I think this trick is done to avoid doing a full blown Cubic Hermite spline interpolation which involves looking up 16 values and evaluating the cubic Hermite spline equation 5 times. Is this just a remapping trick or is there some mathematical concept behind it?

When I looked up smoothstep in Wikipedia, it says

In HLSL and GLSL, smoothstep implements the $S_1(x)$ the cubic Hermite interpolation after clamping

However, Hermite interpolation it links to is different from Cubic Hermite spline interpolation; they're two different articles. Former seems to be a kind of Polynomial Interpolation. I'm confused as to what this function really is/does at a deeper level.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.