LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: Cornix on March 26, 2013, 12:13:49

Title: What is a safe texture size (even for older Graphics Cards)
Post by: Cornix on March 26, 2013, 12:13:49
The title says it all.
With what texture size will I be safe even on older Hardware?
Or weaker hardware like on laptops and netbooks?

Right now i am using 1024x1024 and 2048x2048 textures; but can i go up safely or do i need to fear that older machines will not be able to load such textures?
Title: Re: What is a safe texture size (even for older Graphics Cards)
Post by: quew8 on March 26, 2013, 12:29:34
This is from the red book version 1.1:
QuoteThe maximum size of a texture map depends on the implementation of OpenGL, but it must be at least 64 ´ 64 (or 66 ´ 66 with borders).
.
So in theory, if you're going for maximum compatibility, 64 x 64 is the maximum, however I think you would be hard pressed to find any hardware nowadays that doesn't support larger textures and is still in working condition. It's a hard thing to say but I think your safe with 2048 but perhaps any larger and some hardware will not cope. Saying that I have a feeling that if a texture is too large, most implementations simply store it in client memory. This is far from ideal however in terms of speed.
Title: Re: What is a safe texture size (even for older Graphics Cards)
Post by: Cornix on March 26, 2013, 12:31:33
Hm, i see. Thanks for the answer.
64x64 sounds pretty terrible.

So even if we say the max texture size for a given hardware is 1024x1024; would a texture array with several 1024x1024 textures work? Would be kinda contradicting i guess but i seriously dont know.
Title: Re: What is a safe texture size (even for older Graphics Cards)
Post by: Mickelukas on March 28, 2013, 08:27:53
I've had problems with cards not supporting 2048x2048, but never with 1024x1024.

1024x1024 is then the max size for the entire texture atlas (meaning for example 8x8 textures of 128x128 in size).

Mike
Title: Re: What is a safe texture size (even for older Graphics Cards)
Post by: Cornix on March 28, 2013, 09:54:36
Quote from: Mickelukas on March 28, 2013, 08:27:53
I've had problems with cards not supporting 2048x2048, but never with 1024x1024.

1024x1024 is then the max size for the entire texture atlas (meaning for example 8x8 textures of 128x128 in size).

Mike

You mean a Texture array of 8 128x128 textures, right?
Title: Re: What is a safe texture size (even for older Graphics Cards)
Post by: aleator on March 28, 2013, 15:04:14
You can check the values in the Implementation Dependent Values table of the OpenGL spec.

For OpenGL 3.2 (Core Profile) (http://www.opengl.org/registry/doc/glspec32.core.20091207.pdf) it says on page 302 in table 6.37:

MAX_TEXTURE_SIZE - Minimum Value: 1024

So on OpenGL 3.2 you've got a guaranteed texture size of 1024x1024px.

EDIT: minor spelling fix
Title: Re: What is a safe texture size (even for older Graphics Cards)
Post by: Cornix on March 28, 2013, 16:34:59
Thats great news, thank you for the information.