View Full Version : GL Texture data memory issues

03-07-2002, 09:28 AM
I am working on an application that loads image files and displays them as textures mapped to 3D triangulated meshes.

However, the file sizes can potentially require the generation of some 30 or more textures at the maximum texture size that GL can handle. It appears that OpenGL stores all the pixel data in memory for each of the textures, so that this can potentially use a ton of memory.

Is there some way to tell GL to store a texture in some kind of compressed data format?

03-08-2002, 02:23 AM
Yes, depending on what requirements you have for your texture colors you could save space with 8 bit paletted or 16 bit RGB textures (check out the internalFormat parameter of glTexImage2D), or use GL_ARB_texture_compression.

03-08-2002, 04:34 AM
You should also have a look at the SGIS_texture_lod extension to constrain mipmap ranges. This requires some logic on your part but if done right, you can effectively page unneeded (very large) mipmap levels out of texture memory when an object is far away.

Remember that the maximum number of texels required for a scene is roughly the same as the number of pixels (or rather fragments) in your viewport. Higher detail mipmap levels won't get sampled anyway, so you only need to upload the highest detail mipmap level when it is zoomed in very close. Excessive texture detail will only bog you down and won't add anything visually.