31/08/2009 OpenGL tip: Compressed textures

Few days ago I was working on compressed textures and speaking with OpenGL community member I realized how tricky it could be. There are workaround that can help to make compressed textures work that shouldn't be used because there is no need!

  • No need of glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE)
  • No need of glGenerateMipmap(GL_TEXTURE_2D)
  • No need of glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, ...)

Like uncompressed textures, mipmaped compressed textures require that all mipmap levels be loaded, means until mipmap 1x1. However DXTC format is back on block of texel so how does it works for mipmaps that size is smaller than a block? These mipmaps are saved in a block of memory of the size of DXT block.

Finally, using GL_COMPRESSED_RGB as an internal format when loading an uncompressed image use to give an awful result ... it's not the case anymore! It's always better to generate the compressed image offline but still what drivers do those day is good at least on nVidia side.

My Google reader shared items >
< Matrix inverse integrated in Spin-X Engine
Copyright Christophe Riccio 2002-2016 all rights reserved
Designed for Chrome 9, Firefox 4, Opera 11 and Safari 5