microsoft / DirectXTex

DirectXTex texture processing library
https://walbourn.github.io/directxtex/
MIT License
1.74k stars 426 forks source link

Low quality DXT compression #463

Open xrModder opened 3 months ago

xrModder commented 3 months ago

I'm using DirectXTex to save DDS textures. I noticed that DirectXTex, compared to other tools, when saving textures in the compressed DXT format, loses detail, especially during smooth transitions. For example, on the very old X-Ray SDK (S.T.A.L.K.E.R.), the quality of texture compression is much better (in the X-Ray SDK, for some reason, the dither flag does not affect the compression quality, textures without and with dither are binary identical).

Comparison ![Comparison](https://github.com/microsoft/DirectXTex/assets/53347567/ea848ddf-e058-4f8e-bd68-177b285342c3)

Test textures: Textures.zip

How to achieve high quality DXT compression using DirectXTex?

Sorry for my English (I write through a translator).

suphamster commented 3 months ago

I agree with you, "NVIDIA Texture Tools Exporter 2024.1.0" gives much better quality than "texconv.exe" when converting from BC7 to DXT5 (BC3_UNORM_SRGB) using same settings.

walbourn commented 3 months ago

@suphamster Why would you convert from a higher quality compression to a lower-quality compression and expect good quality?

suphamster commented 3 months ago

Garage_cmp.zip I've attached zip with 3 dds files to compare (original BC7, "NVIDIA Texture Tools Exporter 2024.1.0" and "texconv.exe" both DXT5). I expect resonable quality after compression without much loss (look at red car front) that happens after using texconv.exe in my case. Upd: "-bc u" parameter makes image better (removes pixelation in some cases) but still not so good as using NVTTE (that has features like gauss blur or smoothing to get rid of blocking artifacts),