|Original post by phantom|
To be fair your requirements differ from those of games;
I don't think they do, actually. Although the style of the game (and its textures) surely matter, I think that it mostly depends on the player
. While the intensity of texture artifacts generated by DXTC is definitely dependent on the type of textures you use, there is a lot of visual psychology involved as well.
Now, let's not kid ourselves here: DXTC is a horrible compression. The first and foremost priority with the development of DXTC was easy and efficient hardware implementation on GPUs that are now many generations old. It was not quality. Compared to other lossy systems, such as DCT or DWT based ones, DXTC is unbelievably primitive. But it can be decoded easily by GPUs, while DCT/DWT cannot (yet). This is a huge advantage - albeit its only one.
DXTC cannot be used to store work-in-progress assets during development. You need a lossless format for that, otherwise you'll kill your texture in no time due to entropy. Sure you could use DDS in lossless mode, but PNG is better in that regard (higher compression ratio, wider adoption, etc). So, if you want your engine to load compressed DDS files, you have to run a 'compilation' step on all your textures. This adds an additional time consuming and potentially error prone step to the build pipeline. If you use a lossless format, you can directly load your work textures during development, almost directly out of Photoshop. Much more convenient.
Of course, the question remains if textures should be compressed in VRAM or not. I think that this choice should be left to the player. People react very differently on compression artifacts. Some will never see them, others will be driven crazy by them. By storing textures as compressed DDS on disk, you force everyone to use the textures that you
deemed compression-worthy. Even if you don't see a problem with DXTC'ing a particular image, someone else might be annoyed by the artifacts. The human brain is a strange machine :)
Also keep in mind that some shaders will greatly enhance the visibility of artifacts. Even diffuse maps that look good with DXTC in a raw state can suddenly look terrible with a particular shader applied.
So I make it a preference switch. You don't lose anything, and gain a lot. If your players upgrade their graphics card, they can turn off compression and your game will look better without any additional costs. Users with lower end cards just turn DXTC on. If some day someone manages to create a better VRAM compression algorithm either in hardware or through shaders, using it in your game is the matter of changing a few lines of code. No need to rebuild any asset.
Let me dispel another myth, that offline DXTC compression looks better than on-the-fly. This is not true. It used to be true when people compared offline with the drivers' built-in compression, which could indeed have a very bad quality. Nowadays, the driver compression has improved a lot. And if you don't like it, just use your own implementation while loading. The overhead is minimal when using multi-core plus SIMD, and the quality is practically identical to offline compressors for most of the (many) tests we did.
So in the end, I see DXTC as a necessary evil to conserve VRAM and texture access bandwidth. However, I don't see it as an appropriate format to store your textures in, because much better algorithms exist for that. Use the appropriate tool for any given job.
|Original post by phantom|
|Original post by Yann L|
Besides that, I'm not sure how DXTC would actually compress. DXTC is a pretty crude compression system design for speed rather than quality. It generates a lot of quantization errors that could limit the way a lossless compressor may process the data. But I never tried it. Could be interesting to do.
So, yeah, YMMV but it looks like zip compression with DXTn compressed files is a good bet.
The results are interesting. So, if you're very tight on storage space and/or have specific restrictions in that regard, then using DXTC+zip is indeed a good bet.
However, to be entirely fair, you'd have to consider JPEG as well as a storage format. Or even a DWT-based lossy compression. The figures would look entirely different then.