Largest safe texture size?

Started by
4 comments, last by Zorodius 21 years, 2 months ago
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?
You don't need to vote for the "lesser of two evils"! Learn about Instant Runoff Voting, the simple cure for a broken democracy!
Advertisement
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]
Thanks!!
You don't need to vote for the "lesser of two evils"! Learn about Instant Runoff Voting, the simple cure for a broken democracy!
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?
You don't need to vote for the "lesser of two evils"! Learn about Instant Runoff Voting, the simple cure for a broken democracy!
glGetIntegerv

(500 x 1)

http://users.ox.ac.uk/~univ1234
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

This topic is closed to new replies.

Advertisement