Skip to main content
GameDev.net gamedev.net
🔒 Locked

textures-max size ?

Started by ade-the-heat Jul 15, 2004 at 10:17 AM 2 replies 700+ views
Original Post
ade-the-heat
ade-the-heat
Hi, I have a texture 700x700 and 1,400k for my skybox- is this too big ? If so - then what's the biggest - I'm at opengl version 1.4 cheers
Myopic Rhino
Myopic Rhino
Texture sizes should be a power of 2. It's possible to get around that, but why overcomplicate things?

The maximum size is implementation-dependent. You can find out the maximum texture size by calling glGetIntegerv() with GL_MAX_TEXTURE_SIZE. Modern video cards support up to 2048x2048 or 4096x4096 textures.
_DarkWIng_
_DarkWIng_
Max texture size depends on your GPU. It's usualy 2048x2048 or 4096x4096.

GLint max_texture_size;
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max_texture_size);

Be carefull with those texture sizes you have now. Most HW only supports power-of-2 texture sizes.

edit: beaten to it by Myopic Rhino...
You should never let your fears become the boundaries of your dreams.
Enigma
Enigma
The Red Book recommends using proxy textures to ensure that you can use a texture of the size and format that you desire:
Quote:
Red Book Chapter 9 - TextureMapping:
To an OpenGL programmer who uses textures, size is important. Texture resources are typically limited and vary among OpenGL implementations. There is a special texture proxy target to evaluate whether sufficient resources are available.

glGetIntegerv(GL_MAX_TEXTURE_SIZE,...) tells you the largest dimension (width or height, without borders) of a texture image, typically the size of the largest square texture supported. However, GL_MAX_TEXTURE_SIZE does not consider the effect of the internal format of a texture. A texture image that stores texels using the GL_RGBA16 internal format may be using 64 bits per texel, so its image may have to be 16 times smaller than an image with the GL_LUMINANCE4 internal format. (Also, images requiring borders or mipmaps may further reduce the amount of available memory.)

A special place holder, or proxy, for a texture image allows the program to query more accurately whether OpenGL can accommodate a texture of a desired internal format. To use the proxy to query OpenGL, call glTexImage2D() with a target parameter of GL_PROXY_TEXTURE_2D and the given level, internalFormat, width, height, border, format, and type. (For one-dimensional textures, use corresponding 1D routines and symbolic constants.) For a proxy, you should pass NULL as the pointer for the pixels array.

To find out whether there are enough resources available for your texture, after the texture proxy has been created, query the texture state variables with glGetTexLevelParameter*(). If there aren't enough resources to accommodate the texture proxy, the texture state variables for width, height, border width, and component resolutions are set to 0.


Enigma

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.