Support compressing KTX2 textures without CLI
See original GitHub issueIs your feature request related to a problem? Please describe. I’m in the process of updating from 2.1.7 to 2.4.2 (due to the toktx command changes), but running into what looks like “incorrect but somehow working” use of the library.
In 2.1.7, we were using something like
import { NodeIO, PropertyType } from '@gltf-transform/core';
import { draco, toktx } from "@gltf-transform/cli";
...
await document.transform(
// see https://github.com/donmccurdy/glTF-Transform/blob/main/packages/cli/src/transforms/toktx.ts
toktx({ mode: Mode.ETC1S }),
draco(),
);
It looks like in 2.4.2 draco
has moved into /functions
, but otherwise this still works.
How can we use the simplicity of the toktx command but not depend on the CLI? Might be missing something obvious here!
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Support decompressing KTX2 textures · Issue #591 - GitHub
Describe the bug KTX2 textures are not converted when demanded using the CLI. To Reproduce Steps to reproduce the behavior: gltf-transform ...
Read more >KTX2 Compressed Textures - Babylon.js Documentation
Learn advanced texture compression with KTX2 support in Babylon.js.
Read more >How to create ktx2 correctly - Questions - three.js forum
The reason is that the Basis Universal GPU Texture Compression tool which is responsible for interpreting KTX2 file to GPU supports, ...
Read more >basis_universal - Google Git
KTX2 files have built-in lossless compression support using Zstandard, which is used by default on UASTC textures. Basis Universal is not an image...
Read more >Khronos Texture Tools: ktxsc
ktxsc can encode and supercompress the images in Khronos texture format version 2 files (KTX2). Uncompressed files, i.e those whose vkFormat name does...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yep, we were. We also ended up doing what you recommended and moving the toktx scripts out of the CLI package into our own, to get rid of the CLI dependency.
@hybridherbst were you able to get the v2.4.2 update working?