PDA

View Full Version : 3d texture x,y,z size



lobbel
08-28-2009, 08:37 AM
Hello,

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.

regards,
lobbel

ZbuffeR
08-28-2009, 09:23 AM
(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.

lobbel
08-28-2009, 03:33 PM
Hi,
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 ??

regards,
lobbel

ZbuffeR
08-28-2009, 04:09 PM
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 3*5*7 ?

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);

lobbel
08-29-2009, 12:07 PM
Hello,

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.

regards,
lobbel

lobbel
08-29-2009, 02:00 PM
Thanks ZBuffer. The glPixelStorei made it work.


regards,
lobbel