Archived

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

robsonde

Textures :- how big is too big?

Recommended Posts

I want a texture of 1024*1024. this will go on to one poly that will fill most of the screen. can OpenGL do textures this size? will it work on all video cards? should I do 4 smaller polys and 4 smaller textures?

Share this post


Link to post
Share on other sites
yes and no and no.
If you have a weak video card(read, any 3dfx card), you might have problems. But people with those cards don''t deserve to play your game anyway. Unless you have one, of course =P

geforce 3/4 have a 4kx4k limit i believe, and i''m sure the radeons are similar

Share this post


Link to post
Share on other sites
there is a limit called texture lump size
to calculatie the lump size of a texture you multiply its dimensions:
with*height

i am not sure whats the limit nowerdays but in former times it was 65536=256*256

but i am sure they increase the maximum lump size

Share this post


Link to post
Share on other sites
You shoud query the maximum supported size of a texture by calling glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTexSize). It returns the maximum width and height that is supported by graphics card. So if you want to use 1024x1024 texture, you can but on systems that doesn't support such dimensions you have to resize the texture to maximal supported size.

[edited by - QWERTY on November 11, 2002 7:38:38 AM]

Share this post


Link to post
Share on other sites
You''re actually better off using a texture proxy.

Quoted from the Red Book:

glGetIntegerv(GL_MAX_TEXTURE_SIZE,...) tells you a lower bound on the largest width or height (without borders) of a texture image, typically the size of the largest square texture supported. <snip>

However, neither GL_MAX_TEXTURE_SIZE not GL_MAX_3D_TEXTURE_SIZE considers the effect of the internal format or other factors, such as mipmapping. 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. <snip>. For a proxy, you should pass NULL as the pointer to the texels 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.

End Quote.

Hope this helps,

Enigma

Share this post


Link to post
Share on other sites