KhronosGroup / 3D-Formats-Guidelines

Guidelines for artists and developers using Khronos Group 3D formats.
Other
123 stars 17 forks source link

gltf-transform command suggested in KTX Artist Guide doesn't work #16

Open OptiStrat opened 2 years ago

OptiStrat commented 2 years ago

This section suggests that one can convert to ETC1S format all textures tied to a glTF file with: gltf-transform etc1s input.glb output.glb --verbose

Assuming this command should work with a .gltf input as well, if I attempt to convert the reference stained glass lamp model, the command fails with the following message:

warn: Expected KTX-Software >= v4.0.0-rc1, found v4.0.0-60-g1f085d30. debug: Texture StainedGlassLamp_grill_normal.jpg (normalTexture) debug: • toktx --genmipmap --bcmp --normal_map --assign_oetf linear --assign_primaries none /tmp/tmp-149058-ssajk7wetT02-.ktx2 /tmp/tmp-149058-CLaOagTPHN3l-.jpg

error: • Texture compression failed: ...

Unless this has to do with the warning I get about expected KTX-Software version, this might technically be an issue with gltf-transform calling toktx with the wrong flags. => adding @donmccurdy.

(I understand that it's usually not a good idea to compress normal maps to ETC1S. I'm just doing some quick tests of the different tools available for manipulating 3D assets, with focus on "does it work (at all) in my current dev environment".)

OptiStrat commented 2 years ago

The command in this section doesn't work either.

The flag --rdo-quality doesn't seem to be available anymore in gltf-transform v1.0.1 (--rdo seems to have replaced it?)

donmccurdy commented 2 years ago

The command gltf-transform etc1s input.glb output.glb --verbose does work on the latest gltf-transform, KTX-Software, and the lamp model above (at least on my machine), so a few follow-up questions:

  1. What version of gltf-transform are you using?
  2. What operating system?
  3. Is KTX Software installed from prebuilt packages or built from source?
  4. After the Texture compression failed: ... at the end of your error snippet, was there any other error output?
  5. If not, can you run the command that failed (toktx --genmipmap --bcmp --normal_map --assign_oetf linear --assign_primaries none /tmp/tmp-149058-ssajk7wetT02-.ktx2 /tmp/tmp-149058-CLaOagTPHN3l-.jpg in this case) and see any other output? You may need to re-run the original gltf-transform command first to create the tmp files.

The --rdo-quality option was replaced by --rdo back in March (in KTX-Software) and so glTF-Transform was updated to include that. The two are not the same thing though, and do not take the same values. The document should probably be updated to use --rdo, yes.