Archived

This topic is now archived and is closed to further replies.

Largest safe texture size?

This topic is 5437 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I know that some texture sizes don''t work on some cards. I''d like to know what the largest texture I can use is that will be guaranteed to work on all cards? What about when using gluBuild2DMipmaps? Does this allow me to use textures of any size without a chance of it screwing up?

Share this post


Link to post
Share on other sites
The maximum size guaranteed to work is 64x64, as required by the spec. However, literally all cards can use at least 256x256, and you can get card specific maximum with glGetInteger with GL_MAX_TEXTURE_SIZE. You can then provide large textures, and scale them if they are too large for the hardware. And mipmaps have the same rules as non-mipmap textures. Power of two dimensions, and no larger than what glGetInteger with GL_MAX_TEXTURE_SIZE returns. Just don't be fooled by gluBuild2DMipmaps. If you pass an "invalid" texture size to gluBuild2DMipmaps, the image will be resized to a valid texture size before being uploaded as a texture.

[edited by - Brother Bob on January 29, 2003 6:41:51 AM]

Share this post


Link to post
Share on other sites
Further investigation suggests that no glGetInteger function exists, (althoug GL_MAX_TEXTURE_SIZE has been defined), and I can''t find anything on MSDN that sounds like it would accomplish the same task.

What am I screwing up?

Share this post


Link to post
Share on other sites
yes use GL_MAX_TEXTURE_SIZE this will tell u the largest texture size for a machine though the safest way is to test the actual texture with proxy textures + see if it works ie a 2048x2048 texture might work with LUMINANCE but not with RGBA8.
check the opengl spec or the red book for details on how to do this

http://uk.geocities.com/sloppyturds/kea/kea.html
http://uk.geocities.com/sloppyturds/gotterdammerung.html

Share this post


Link to post
Share on other sites