Jump to content

  • Log In with Google      Sign In   
  • Create Account

Calculating gradients during fast third order interpolation


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 rtclawson   Members   -  Reputation: 168

Like
0Likes
Like

Posted 19 April 2013 - 09:39 AM

I am using a method described in the GPU Gems book (http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter20.html) for Fast Third-Order Texture Filtering. I have it working well for filtering volume textures. I would now like to calculate 3D gradients for use as surface normals for shading.

 

The article states that this is possible as part of the filtering step, and offers an example in one dimension. They hand wave the possibility of extending the process to multiple dimensions, but it isn't at all clear how this leap should be made. Here is the relevant sentence:

 

"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."

 

Any ideas on how to accomplish this? Obviously I could just sample the texture a few more times and calculate the gradient on my own, but since I already have the samples from the filtering, it would be faster if I could calculate the gradient from them.

 

Thanks for your help!

 

Note: this post also appears in the Graphics Programming and Theory forum. I am not sure in which I will find the right person to reply.



Sponsor:

#2 rtclawson   Members   -  Reputation: 168

Like
0Likes
Like

Posted 24 April 2013 - 12:08 PM

Someone can correct me, but I don't believe it is possible to compute the high quality gradients without doing more texture samples. I think what is being said in the article is that the same procedure for calculating the pixel value can be used to calculate the gradients, but they are separate processes. Under this model, there are 8 texture samples for the pixel value, and 8 samples each for the 3 cardinal directions. An extra 24 texture samples isn't as great as I would have hoped, but the gradient does look better than when it is computed using central differencing.



#3 apatriarca   Crossbones+   -  Reputation: 1703

Like
0Likes
Like

Posted 27 April 2013 - 04:57 AM

B-splines curves have closed form derivatives (of any degree). The derivatives are B-spline curves of lower degree. To compute your gradient you probably have to substitute the basis functions with their derivatives and then evaluate the result using the same recursive method.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS