Followers 0

# Calculating gradients during fast third order interpolation

## 2 posts in this topic

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.

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.

0

##### Share on other sites

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.

0

##### Share on other sites

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.

0

## Create an account

Register a new account