Skip to content

example code for ktx2 compression #252

Answered by donmccurdy
tom-deadline asked this question in Q&A
Discussion options

You must be logged in to vote

Several tools for converting textures to .ktx2 are discussed here:

https://github.com/KhronosGroup/3D-Formats-Guidelines/blob/main/KTXArtistGuide.md

The glTF-Transform CLI is one of them, and you can find my KTX conversion code in the repo as part of the CLI. Note that it relies on having KTX-Software installed to the machine, providing the toktx CLI program, and isn't a plain JavaScript solution.

If you need plain JavaScript and/or WASM, the basis_universal repository recently added a WASM KTX2 encoder, but I haven't worked with it yet: https://github.com/BinomialLLC/basis_universal/blob/master/webgl/ktx2_encode_test/index.html

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@tom-deadline
Comment options

@donmccurdy
Comment options

Answer selected by donmccurdy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
2 participants