PDA

View Full Version : size of 3D texture



micho2
12-01-2004, 12:39 AM
Hi,
my graphics card (6800) support the 3D texture with the resolution 512^3, but if I upload the 3D texture with this resolution, I see just white quad. glGetError returns GL_NO_ERROR. If I use 513^3, glGetError returns GL_INVALID_ENUM. If I use 481^3, glGetError returns GL_NO_ERROR and I see what I expect. If I use lower resolutions like 481 everything is ok. If I use higher resolutions like 481 I see white quad with GL_NO_ERROR.

My question is: how can I exactly know the "correct" resolution of the 3D texture?
Is it restriction of memory?
I had same problem with gf4600Ti, gf5200.

Thanks.

PS:
glGenTextures(1, &volume->tex3d);
glBindTexture(GL_TEXTURE_3D,volume->tex3d);

glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_3D,GL_TEXTURE_WRAP_S,GL _CLAMP);
glTexParameterf(GL_TEXTURE_3D,GL_TEXTURE_WRAP_T,GL _CLAMP);
glTexParameterf(GL_TEXTURE_3D,GL_TEXTURE_WRAP_R_EX T,GL_CLAMP);

glTexImage3D(GL_TEXTURE_3D,0,GL_INTENSITY,Resx,Res y,Resz,0,GL_LUMINANCE, GL_UNSIGNED_BYTE, data);

Relic
12-01-2004, 02:21 AM
Strange. Try this: Keep wrap modes on default GL_REPEAT and use GL_INTENSITY8 as internalFormat.
(I don't think GL_TEXTURE_WRAP_R_EXT is necessary, GL_TEXTURE_WRAP_R should be defined.)

If that doesn't make a difference, check your AGP aperture in the system BIOS and crank it up (256 MB).
512^3 Intensity 8 is 128 MB, maybe there wasn't a big enough block in the video memory left and/or the AGP memory was too small.

micho2
12-01-2004, 11:57 PM
Hi Relic,
Now everything works ok.
It was because AGP and BIOS settings.

Thanks