ARB_texture_compression and gluBuild2DMipmaps

Does gluBuild2DMipmaps work properly if I specify a compressed internal format for the texture? (the image data is not compressed)

Thanks in advance,
-Lev

It seems to for me

– Zeno

Yes. Remember that the documentation that tells you that gluBuild2DMipmaps has a “components” argument is wrong; the argument has been renamed to “internalformat”, and the value passed in should be completely ignored and passed on to GL.

  • Matt

thx! yesterday I took a closer look at the extension and it seems that I can compress all my static textures (dynamic must be uncompressed since glTexSubImageXD wont work with comrpessed) just by cahnging 1 argument of gluBuild2DMipmaps/glTexImage2D. This is pretty cool. Well I have 2 more questions:

But what about the image quality? I guess it does depent on a compression algorithm and since ARB does not specify which one must be used the quality may vary on different hardware, is that true?

Does it take much time to compress a texture?

Thanks in advance,
-Lev

P.S. At the moment I have no access to any dev. environment so I can’t just write these 20 lines and test it, thats why i’m asking.


But what about the image quality? I guess it does depent on a compression algorithm and since ARB does not specify which one must be used the quality may vary on different hardware, is that true?

Yup, you can give a few hints though, but nothing more if you want it general. Adding support for S3TC could be an idea if you want finer control on hardware that supports it.

That is, if your program recognizes the type of texture compression used by the hardware, it can control the compression to achieve better quality/performance.

You should, however, make this optional since there may be cards in the future that supports both S3TC and some new Better Looking™ technology, and thus forcing S3TC because it is supported may not be all that wise.


Does it take much time to compress a texture?

Depends on texture size/cpu/algorithm, but you don’t want to do it for dynamic textures. Doing it even at every start of your game/app is quite a drag too.