View Full Version : Undersampled 3D texture when zooming

Sebastien Tosi
02-05-2018, 02:39 AM

I am using Tao OpenGL C# framework to perform interactive 3D volume rendering (maximum intensity projection). The results are good for small texture (up to 128 x 128 x 128), but when I move to larger texture size then details are lost (the texture still fits in GPU memory). More concretely, it seems that the texture is always undersampled: when zooming, sampling is not adjusted but interpolation performed on undersampled data.

To illustrate this, I created and rendered test textures (nearest neighbor interpolation, edge clamping). The larger textures are made by repeating exactly the same image as the smallest texture. The view is always zoomed to fit the same field in a fixed size 512x512 Window. The textures are respectively: 128x128x32 (top), 512x512x32 (bottom left), 1024x1024x32 (bottom right).

I have been pointed out that it might be a problem of insufficient texture coordinates precision in the fragment shader, I am not sure how to remedy…

The code of the complete project is attached, it is quite readable and not too long but it runs in Matlab (C# bindings).

I hope somebody can give me some directions to follow...