I’m currently trying to compress textures inside a GLTF with KTX2, but nothing I’ve tried so far worked. Maybe someone more familiar with the process could help me find out what I’m missing. Most likely @donmccurdy?
I’ve tried the following:
- 1/ using gltf-transform:
gltf-transform etc1s start.glb output.glb --verbose
gets me the error error: Cannot convert undefined or null to object
. I’ve tried with version 2.2.0
as well as 2.2.1-alpha.0
built from the repo.
- 2/ by editing the json file:
Following the instructions here and here
where I’d add the following to the json:
"extensionsUsed":["KTX_texture_basisu"],
"extensionsRequired":["KTX_texture_basisu"],
and setting the textures like this:
"textures":[
{
"source":0,
"extensions":{
"KTX_texture_basisu":{
"source":0
}
}
}
],
"images":[
{
"uri":"metal_grate_rusty_diff_1k.ktx2",
"mimeType":"image/ktx2"
}
],
And while I can create a glb file from this using gltf-pipeline, I get the error THREE.GLTFLoader: Couldn't load texture blob
when trying to read it. And reading it also fails on https://gltf-viewer.donmccurdy.com/
Here is what the glb should look like:
I’ve attached the glb used as input in 1/ and the files zipped together for 2/.
Thanks a lot in advance if anyone can spot what I miss.
start.glb (383.4 KB)
gltf_files_with_ktx2_texture.zip (158.8 KB)