Skip to main content
GameDev.net gamedev.net
🔒 Locked

Finding normals using uniform b-spline derivative on a heightmap

Started by d0nuts Apr 3, 2016 at 2:33 AM 0 replies 2.3k views
Original Post
d0nuts
d0nuts

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!

d0nuts
d0nuts

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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.