Ages ago, i made a tool for Fallout 4 that is really just a frontend for xtexconv, to reduce the resolution of textures that are of a specified size. But there is an inherent quality loss when re-compressing a DDS image, like doing [b].jpeg -> reduce resolution by 50% -> save as .jpeg[/b]. Same gig with MP3 files.
So I was thinking. Instead of re-compressing the .dds image to fit the new dimensions, what about just removing the preceeding mipmap levels? So if a texture is 4098x4098, mipmap 1 is 2048x1024, mipmap 2 is 1024x1024, mipmap 3 is 512x512, you'd just remove mipmap 0, and mipmap 1, to make it into a 1024x1024 texture at mipmap 0, 512x512 at mipmap 1, etc.
Is that possible? If it's just that there isn't a tool to do that, and there are APIs that can accomplish that, I'd get to work on it. Just need pointed in the right direction.
Replies
I guess the point would be you have to re-shuffle the data inside the dds without re-encoding it and just pushing existing bits to new locations.
I don't know of any such tool but would be interesting to know.
Though I would argue that you don't loose too much quality if you shrink an existing mipmap by half and re-encode it. Do you have a comparison where you see an actual visible quality loss?
It's especially prominent with normal maps, as the details are just destroyed. Keep in mind this is also Fallout 4, which has rather...interesting texture design. I'll post a wee update once it's finished downloading, which will take a while on my naff broadband.
MSDN is the reference for DDS
https://docs.microsoft.com/en-us/windows/win32/direct3ddds/dx-graphics-dds-pguide
There are example tools on GitHub here
https://github.com/Microsoft/DirectXTex
Yup, and those mipmaps were generated from the source, non-lossy compressed images. Re-compressing them again to the same resolution as one of the mipmaps loses even more data.
Comparison!
But I wonder what happens in practice.
That's also not indicative of the real color loss you get.
Try it with a real texture.
It lets you load a dxt and show all the MIPs. Then just crop out the highest MIPs and re-save.
If you use the same compression format as before (not sure which dxt Fallout used!) then it should give you a decent result.