google / draco

Draco is a library for compressing and decompressing 3D geometric meshes and point clouds. It is intended to improve the storage and transmission of 3D graphics.
https://google.github.io/draco/
Apache License 2.0
6.47k stars 962 forks source link

Error on decompression: Invalid index into function table #662

Open darkverse opened 3 years ago

darkverse commented 3 years ago

Hi,

I have been trying to track down a problem when decompressing a model in BabylonJS and they have suggested it might be an issue for the Draco team. I am not sure where the problem rests - Draco, Babylon or Blender. The error only occurs on a mobile or a Quest (both android devices), but it works fine on a PC - the phone I tested on was a Samsung Galaxy S7. I think it is related to animations/skinning/morphing as two of my models that do work don't have animations while the problematic one does.

The model started as a highly detailed SolidWorks model then imported into Blender 2.9 and simplified as much as possible without loosing too much detail, an armature added with a simple animation and exported as a GLB file with draco compression. While testing I have created two versions of the file with the only difference being the export settings in Blender - both files pass validation tests but one of them fails to decompress (on a mobile device) whereas the other works.

This model fails - exported with compression level 6 and animations and shape keys and skinning.

This model works - exported with compression level 3 and animations but without shape keys and skinning.

There is a discussion on Babylon forum here https://forum.babylonjs.com/t/glb-import-error-only-on-quest-or-phone/15827

there are minimal working examples here: Model 1 fails Model 2 works

The error message is: b972c5574e704c850c091700932893f370154bd6_2_1035x202

Any help or suggestion would be appreciated. Thanks.

tomfinegan commented 3 years ago

@darkverse Is this still an issue with the latest release? This was posted the day after the v1.4.1 release.

We're not able to reproduce a problem using either link, but we also lack access to either of the devices you mention as potentially being part of the problem.

darkverse commented 3 years ago

Thanks for the reply Tom. It is still an issue for me but I am using the tools that are bundled with Blender 2.92 and Babylon 4.2 so I do not know if they are using the v1.4.1 release that you mention. Should I try with other tools such as gltf-pipeline or the draco module directly?

I had previously tried draco (installed via npm) but that was v1.3.4, ie export uncompressed from Blender and then compress with draco via cli, so perhaps I should upgrade my draco module and go back to that process.

darkverse commented 3 years ago

I just updated gltf-pipeline and draco3d so I am now using v1.4.1 but I get the same results. Is it perhaps a problem with buffers being >65536?