Converting from DDS to KTX2 - How to keep custom mipmaps?

Hello!

I have a number of DDS files with custom made mipmaps that I need to convert to KTX2. The following creates new mipmaps instead of porting over the existing ones:

nvtt_export input.dds -o output.ktx2

How can I read the existing mipmaps from the DDS file and convert them to KTX2?

It’s for some lights in a texture that need to retain visibility with growing distance. --scale-alpha helps to a degree but I need to use my own custom created mipmap levels.

It’s the same with the NVIDIA Texture Tools Exporter GUI.

Version used is 2024.1.1

Thank you!

Hi @limesim!

The --no-mips option should work for this – despite its name, it’s short for “don’t generate mips”, and maps to the “Regenerate Mipmaps” option in the UI.

Here’s some example files I converted using nvtt_export mipmap3of7_levels.dds --no-mips -o mipmap_3of7_levels.ktx2 to test it out (courtesy of GitHub - sevmeyer/ktxtest: Test files for the KTX texture format):

mipmap_3of7_levels.dds (5.4 KB)

mipmap_3of7_levels.ktx2 (5.5 KB)

Hope this helps!

1 Like

Works like a charm, thank you so much!!!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.