Neos-Metaverse / NeosPublic

A public issue/wiki only repository for the NeosVR project
197 stars 9 forks source link

Support importing .glb files compressed with Draco #3835

Open Zyzyl opened 1 year ago

Zyzyl commented 1 year ago

Is your feature request related to a problem? Please describe.

Neos does not appear to support .glb files which have been compressed with the open source Draco algorithm (see https://google.github.io/draco/ and https://github.com/google/draco). It seems to fail with entries in the log such as:

21:04:13.847 (144 FPS) Exception when importing D:\Neos IO\New folder\cube_compressed.glb:

Assimp.AssimpException: Error importing file: class DeadlyImportError: GLTF: Draco mesh compression not supported. at Assimp.AssimpContext.ImportFile (System.String file, Assimp.PostProcessSteps postProcessFlags) [0x00084] in <2bbd770ad2e943ec9a89007d8dfbcb77>:0 at FrooxEngine.ModelImporter+d__6.MoveNext () [0x006c2] in <4569e221aae944528482d45ba46712b2>:0

Draco is actively used to share models online due to the reduced filesizes. It also appears that Draco is the compression algorithm used by Blender if compression is selected when exporting to gltf/glb. As such, it seems native support for these files would be useful.

It seems Assimp should already have support for Draco compressed files as of early 2021 (see https://github.com/assimp/assimp/pull/3614), so hopefully this won't be too difficult to implement.

Relevant issues

None

Describe the solution you'd like

I would like Neos to handle importing Draco compressed glb/gltf files as smoothly as it does uncompressed ones.

Describe alternatives you've considered

Pre-importing Draco compressed files into Blender and re-exporting them for use in Neos.

Additional context

I attach a zipped folder containing 2 basic glb files of a cube. One is uncompressed and imports into Neos fine, the other is Draco compressed (by export from Blender) and fails to import into Neos.

Demo cubes.zip

shiftyscales commented 1 year ago

Hmm- I had a read into this. Currently assimp is what we use for asset import. It appears that Draco support for it was merged in during February of 2021.

Hopefully this means that all that would be required on our end is pulling the latest version of it into our project- but I don't know how trivial/non-trivial a task that would be off-hand.

Zyzyl commented 1 year ago

Thanks for looking into it! I hope it's an easy tweak. Although, if it were as simple as updating Assimp, I would have expected us to have support automatically via one of the Assimp updates Froox did in 2021 (e.g. this pull https://github.com/Neos-Metaverse/assimp/pull/9)