Jump to content
  • Advertisement
Sign in to follow this  
d0nuts

Finding normals using uniform b-spline derivative on a heightmap

This topic is 902 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!

 

 

Share this post


Link to post
Share on other sites
Advertisement

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.

 

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!