Calculating gradients during fast third order interpolation

Started by
0 comments, last by rtclawson 10 years, 11 months ago

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!

Advertisement

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.

This topic is closed to new replies.

Advertisement