Khronos Texture Tools: TOKTX Command Line

Hey @bghgary what are the best command line params to use when using TOKTX.exe to convert a .png to .ktx2

i am using

--t2 --bcmp --clevel 3 --quality 255

But the images look pretty crappy… Are we supposed to enable –genmipmap
cause when i try that the BABYLONJS KTX2 Loaders give an error

When using

--uastc 4 --zcmp 1

From far away looks like crap

but up close looks better

Like its a mipmapping issue… What do you think ???

Yes, you should generate the mipmaps. See also the other thread (Unity Toolkit Basis compression - #5 by Evgeni_Popov).

Generating the mipmaps should work, I did use toktx.exe to generate etc1s/uastc encoded ktx2 files and it did work. Can you a provide a file for which generating mipmaps does not work?

Can you example of your command line you used, including mipmap options ?

I am using two simple png textures


--uastc 2 --automipmap

And i get this in babylon

Here are the ktx2 files it generated that i am trying to load as a texture in a gltf file (16.9 KB)

I think the right flag is genmipmap, not automipmap (can’t remember what automipmap does…)

1 Like