0
$\begingroup$

I just implemented some interpolated texture sampling by sampling the 4x4 nearest pixels then doing Lagrange interpolation across the x axis to get four values to use Lagrange interpolation on across the y axis.

Is this the same as bicubic interpolation or is it different?

Webgl implementation here: https://www.shadertoy.com/view/MllSzX

$\endgroup$
4
  • 1
    $\begingroup$ i think the bicubic interpolation is more likely 3rd-order Hermite polynomial than 3rd-order Lagrange polynomial interpolation. the former guarantees continuity of both the zeroeth and first derivative. the latter only guarantees continuity of the zeroeth derivative (the interpolated function itself). $\endgroup$ Aug 4, 2015 at 19:34
  • $\begingroup$ Does that mean that i'd need to take 6x6 samples to get a 4x4 set of derivatives? $\endgroup$
    – Alan Wolfe
    Aug 4, 2015 at 19:48
  • $\begingroup$ no, i don't think so, if i understand correctly what you mean. take a look at this recent question. cubic Lagrange insures that the 4 coefficients of your cubic polynomial are set so that the polynomial passes through all four points (even though you are interpolating between the middle two). so only the adjacent interpolating functions are continuous, their derivatives might not be. Hermite insures that your cubic polynomial passes through the 2 middle points and that the derivatives are continuous at those 2 points. $\endgroup$ Aug 4, 2015 at 20:09
  • $\begingroup$ You were correct! I've updated that shadertoy and it works great now. Care to make an answer? I'll accept it! $\endgroup$
    – Alan Wolfe
    Aug 4, 2015 at 22:56

1 Answer 1

0
$\begingroup$

i don't need the points, but the Community keeps resurrecting unanswered questions (or answered questions that have no accepted answer) until i go batty seeing them on the list, time and time-again.

:-\

i think the bicubic interpolation is more likely 3rd-order Hermite polynomial than 3rd-order Lagrange polynomial interpolation. the former guarantees continuity of both the zeroeth and first derivative. the latter only guarantees continuity of the zeroeth derivative (the interpolated function itself).

this previous answer deals pretty completely with the necessary math of it.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.