KTX Batch bat doesnt encode PVRT

Today I tried to use the ktx batch scripts located in the official babylon.js repo to optimise some large textures.

The tool gave the following error once for every file:

Error: Invalid values chosen for Encode Format. Please see -help for valid parameters.

At the end there would ever only be the original pngs, the astc, dxt, and etc2 versions.
I think etc1 are missing intentionally, but the script seems to error for pvrt unintentionally.

Is this a know problem? Is there a better easy to use batch encoder maybe using ktx2?

Adding @bghgary. @Leolele99 could you point to which tool you are referring to ?

This tool:

As described in this article:

perfect thanks a lot !!!

Actually those are @JCPalmer s scripts :slight_smile: maybe he ll get an idea ?

2017, good times! The batch script ends up calling this script for every file.

I know it used to do pvrtc files. This is calling a command line program of a company which owns the pvrtc format. I did notice that there is a comment that the files must be square. I have not done this or downloaded their tool in a very long time. Maybe they changed the args. Best thing to do is to follow their advice and add a -help on line 36. When they list the parameters do a compare with the line.

Thank you!

Yeah it seems like the CLI has changed, but even going with their own documentation it doesnt seem to work yet, Ill test further and open a Pull Request once I fixed the issue.

Out of curiosity, is there a more modern tool for similar batch encoding?

There are other tools, but if you want pvrtc, this is the only thing. Astc is taking over though. I have a 2014 Era iPad. Its gpu supposedly does astc, but I don’t think there’s an extension to expose it.

Quest supports astc, so that is all I care about anymore. You need a addin to do that with this tool.

I fixed the problem.

PVRTexToolCLI has some internal changes that havent been added to their documentation yet.

I fixed and tested the errors using some pointers I got in their forums. The official pull request can be found here: Updated Texture Compression batch script to use new PVRTC settings for PVRTexToolCLI. by Leolele99 · Pull Request #11676 · BabylonJS/Babylon.js · GitHub

2 Likes

Thanks a lot !!!