Convert glb file to bunch of basis files

Hi Team,
I need to know … is there any way to convert glb file to collection basis files. right now i have implemented glb load file with sceneLoader append but it taking long time to get result so just asking… is there any other way to covert to basis files from glb url…
basis reference link - Babylon.js Playground

also need to understand regarding gltfpack usage with babylonjs - gltfpack - npm.
Please describe in detail that would be very helpful… thanks

I do not understand what you are trying to do ? A glb file is a model one whereas .basis are “compressed” texture files, I can not understand how you would convert from one to the other.

gltfPack can be used to convert textures inside a gltf file from png or other format to ktx2 textures in order to optimize the asset size. Is it what you are trying to achieve ?

:sweat: i am getting this type of requirement that’s why i asked to convert glb to basis texture files.
what i need to achieve - On long glb file into small junks and load and work simultaneously.
i don’t found any solution regarding gltfPack with babylonjs. so please give me example of convert textures inside gltf file.

You can not do it in Babylon, you need to use gltfpack - npm beforehand through the command line or by using the package in your own node app.

the command should be : gltfpack -i scene.gltf -o scene.glb -tc if I remember well.

@bghgary could confirm ?

On long glb file into small junks and load and work simultaneously

Is there any way to use apart from range request in babylonJS?

Range requests are providing exactly this but relying on gltf who have split files instead of glb might help as requests would be done in parallel.

Instead of Basis, you should look at KTX. Both of these are file containers that support the BasisU payload. KTX is the official one from Khronos and I would recommend using this as it has better support.

You can found out more about this here:
KTX Overview - The Khronos Group Inc

Specifically, if you are looking to compress the textures in your glTF/glb to KTX, you can read this:
3D-Formats-Guidelines/KTXArtistGuide.md at main · KhronosGroup/3D-Formats-Guidelines (github.com)

Hope this helps.

1 Like