DirectXTex icon indicating copy to clipboard operation
DirectXTex copied to clipboard

Low quality DXT compression

Open xrModder opened this issue 11 months ago • 3 comments

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

Test textures: Textures.zip

How to achieve high quality DXT compression using DirectXTex?

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

xrModder avatar Mar 23 '24 02:03 xrModder

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.

suphamster avatar Mar 26 '24 17:03 suphamster

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

walbourn avatar Mar 26 '24 18:03 walbourn

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),

suphamster avatar Mar 26 '24 19:03 suphamster

The implementation in DirectXTex is largely the same as the legacy D3DX CPU compressor which for BC6H/BC7 was more or less a 'reference' implementation. There have been some bugs and improvements made, but no significant changes. The GPU implementation was also a 'proof of concept' that I've maintained.

I do have various improvements on my backlog, and there are some proposed PRs from others I need to review. Maybe at my next Hackathon I'll take some time to work on these.

Thanks for the feedback. I'll keep these files around for future testing.

walbourn avatar Jul 30 '24 16:07 walbourn