3d texture x,y,z size


newer graphic cards support NPOT textures. I’ve got a
nVidia 8800GTX with 768 MB of video memory.

But I get errors when using NPOT 3d textures.
For example 779 * 519 * 429.

It works when I use textures that length i can divide by 4.

I thought with NPOT I can use any length of texture.


(779 * 519 * 429) /1024.0/1024 * 4
-> 661 MB
this is already quite a lot, and there is often some extra space used by NPOT textures.

the size was an example. I think it happens when the size can not be divided by 4. but then whats the sense of npot ? just to be
npot but dependent on 4 ??


NPOT should allow any size.
What I meant is that internally the texture can be padded and take much more texture space, especially for 3D textures. So it can consume texture ram quicker than expected, and may cause an error because of lack of tex ram.

What is your hardware ?

Do you have a list of working/non working npot 3D texture sizes ?
Ie. does it work with a small texture like 357 ?

Beware also that default pixel store alignement is 4, it can matter if you work with less-than-4 channel textures.

Try with these, before glTexImage3d :
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glPixelStorei(GL_PACK_ALIGNMENT, 1);


I use Windows Vista Business x64 and have a
NVIDIA 8800 GTX with 768MB of memory. When i
try loading npot textures that lengths cant be
divided by 4 i get an error when i call
glTexImage3D. Thats when opengl is uploading the data.


Thanks ZBuffer. The glPixelStorei made it work.