My GF4Ti4600 is failing to display a 512x512x128 RGBA8 (128 Mb) texture. It just comes out black and opaque. Smaller sizes such as 512x512x64 work fine. 512x512x128 luminance textures also work.
GL_MAX_3D_TEXTURE_SIZE_EXT is reported to be 512, and no OpenGL errors are spit out.
Is it failing because there is not enough video memory left over after framebuffers and whatnot to contain the whole texture? Is there an error I should be looking for to catch this case? For instance, what if I had enough display lists/VBO or whatever on the card such that a smaller volume doesn’t fit? It would be nice to have the application notify the user instead of simply failing to draw anything.
You should use proxy textures to verify that your texture will fit into video memory. Here’s how to check if your texture will fit:
call glTexImage3D with a target parameter of GL_PROXY_TEXTURE_3D and pass in NULL as the pointer to the texels array. All other parameters to this call should be the same as your usual glTexImage3D call.
Call glGetTexLevelParameter*() with a target parameter of GL_PROXY_TEXTURE_3D to query the width, height, depth, etc… of the texture and if the values returned are 0, your texture couldn’t fit into memory.
jra101- I tried the proxy texture thing. What’s weird is that it accepts the large proxy texture and returns the dimensions I gave it even though the texture itself doesn’t fit in RAM and doesn’t show up on the display. Is this a bug?
Klaus - What you say makes sense - that the whole texture has to fit in video memory. I just wanted to ask to be sure that I wasn’t missing some other problem. Thanks for the links on Bricking . Do you know if texture borders work on 3D textures and if so on what hardware? That’d make the 1 pixel overlap a lot easier and more memory efficient.
Zeno - sorry, i never tried texture borders, so i have no idea if they work. They should …
In OpenQVis (http://openqvis.sourceforge.net/) we don’t use texture borders for bricking. We just duplicate border voxels and adjust texture coordinates.