Storing basis textures in glb files

Is there a way to pack basis textures into glb files? I have had success with manually changing the texture paths in gltf files, but any tools I have tried to compress them after give the following error (babylon gltf playground):

/textures/0: Error while trying to load image: 115,66,19,0,77,0,125,58,233,21,7… - Fallback texture was used

After looking around for tools which support packing basis textures into glb files, I encountered some newer information about KTX2, but neither seem to be supported by any glb pipeline tools.

Does anyone have experience with using basis textures in a glb pipeline?


.glb/.gltf files support basis compression through the ktx2 file format and the corresponding extension (KHR_texture_basisu). I’m not sure any DCC tool supports this extension yet, though, as it has been ratified quite recently.

Hey, and I found gltfpack shortly after I posted that message (link) and it handles creating glb files with ktx/basis compression on the command line. It looks like it will be integrated into gltf-pipeline (link), although not all of the flags that it supports are available in babylonjs (mesh quantization) and I have yet to try modifying the compression settings.

It seems like a good fit for what I am doing, as both packages are available through npm and any requirements could easily be built using wsl2.

Thanks again for the help, and let me know if you think of alternatives.