Draco GLTF Decompression Error

Hey Guys!
Ive been using Draco to compress/ decompress my 3D model sizes, its working fine on OBJ and PLY, but the decompression is not working on GLTF files and im having this error. Is anyone familiar with why this is happening and how to fix it?
draco error

Thanks!!

1 Like

pinging @bghgary

Can you share the model? When you say it’s not working on GLTF files, are you loading it in the sandbox? If you can, set up a playground would be the best way for us to help you.

Hey @bghgary thank you for offering your help!

I am using a car model for this project, where I tested on an obj version and glb version as shown below; both show completely fine on Babylon Sandbox.

original_sizes

Then I compressed both files using Draco

And got the following files; the first file is a resultant from obj while the second is from the glb file.

compressed_files_sizes

Then I used the Draco decoder to decompress the files and show them inside Babylon.
Here is a playground link that mimics what I am working with https://playground.babylonjs.com/#22MFU2#8.
As you can see in the playground, when loading the obj compressed file as the url and using the draco decoder everything works fine. But when you try to use the glb compressed file as the url and use the gltf draco decoder in the configuration it doesn’t work!

Also I have been using the gltf pipeline when compressing the glb model.

Any help is appreciated! Thank you!

DRC is a draco file that only contains geometry and thus you load it directly with DracoCompression class. GLB is a 3d asset. You have to load it with SceneLoader.

https://playground.babylonjs.com/#22MFU2#9

2 Likes

Hey @bghgary thank you so much for your help! This is great! I didn’t know we shouldn’t use the decoder for glb models.

Once again thank you!

2 Likes

Is it okay to use SceneLoader.Append not at the start? The console kept showing this if I do so:
WebGL: INVALID_VALUE: getProgramParamter: attempt to use a deleted object

Or, are there any other ways to do this without warnings? And, how to get the mesh object after I loaded that draco-compressed file?

It should not change a thing when you use it, @gunpowderfans can you share a repro in the playground ?