dv1729
dv1729

Reputation: 1037

S3/DXT/BC compression and texture formats

I know that DXT compression is used because it saves a lot of memory and bandwidth. However, DXT quality is not so good. Is DXT usually used? Are other compressed formats used? Are raw (no compression) formats usually used?

I've read about BPTC Texture Compression too, but I don't have OpenGL 4.x support, just OpenGL 3.x.

I know that there isn't a perfect answer for this question but some "guidelines" would be very helpful.

Upvotes: 3

Views: 3431

Answers (1)

Andon M. Coleman
Andon M. Coleman

Reputation: 43319

There is no usually. It varies by application, and many games will let you select whether you want to compress textures or not to trade quality for performance.

The thing about DXT/S3TC quality is that it varies by the compressor; this is part of the reason formats exist that store pre-compressed textures. Obviously it saves storage and load-time, but the compressed image quality can be improved if done offline (similar to pre-filtering mipmaps using something more sophisticated than a box filter).

Likewise, texture compression algorithms are not applicable for all uses of a texture (especially if the dimensions are not a multiple of 4x4). One of the worst things you can do to a normal map is compress it using conventional DXT. You may have heard of "3Dc" compression, which is really just a variation of DXT5 that maintains certain properties desirable for normal maps but completely unnecessary for traditional images.

As for the differences between BC and DXT, it is mostly down to image quality and versatility. BC 1-3 are actually the same thing as DXT 1-5 and it is only BC6 and BC7 that require D3D10+ class hardware. What GL calls BPTC (BC6H and BC7) partition the 4x4 compression blocks into separate color gradients to improve image quality as needed (which is probably where the P came from).

You will get better image quality and support for sRGB and floating-point texture compression if you have hardware support for BC6H and BC7, but you can live without those things (all DX9 games do).

Upvotes: 2

Related Questions