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.