Advertisement

Finding normals using uniform b-spline derivative on a heightmap

Started by April 03, 2016 02:33 AM
0 comments, last by d0nuts 8 years, 10 months ago

Hey gamedev experts!

I am trying to figure out how to generate smooth normals from a heightmap using b-spline interpolation. I currently have smooth vertex heights working based on the code from this paper [see attached picture :D]. Is my understanding correct that in order to compute the gradient at a point, I need to recalculate the weights using the derivative of each of the weights on page 5 (so w0 = -0.5 * (1 - alpha)^2, etc), recalculate the offsets and weights (g0, g1, h0, h1 variables) in the exact same manner, do three more texture lookups at the newly calculate offsets (so fetch tex00, tex01, tex10), and then compute the partials by weighting across each individual dimension (float dydx = lerp(tex10, tex00, g0.y); and float dydz = lerp(tex01, tex00, g0.x) ?

Sorry for any confusion on my part and thanks for any help!

Or can anyone help me understand the wording from this gpugems article:

To compute the gradient in higher dimensions, we obtain the corresponding filter kernels via the tensor product of a 1D derived cubic B-spline for the axis of derivation, and 1D (nonderived) cubic B-splines for the other axes.

This topic is closed to new replies.

Advertisement