glTF-Blender-IO icon indicating copy to clipboard operation
glTF-Blender-IO copied to clipboard

Gltf errors while using Filament

Open mariuspena opened this issue 3 years ago • 4 comments

Hi

I made a test project here: https://github.com/mariuspena/TestFilament I exported the same model with animation from Blender 2.9.2 - with or without compression (updated to this version because of this issue here: https://github.com/KhronosGroup/glTF-Blender-IO/issues/1326)

and I use them like this: ` //loadGlb("Airplane_Compressed_glb") //loadGlb("Airplane_None_Compressed_glb")

loadGltf("Airplane_Compressed_gltf") //loadGltf("Airplane_None_Compressed_gltf") `

Result:

  • all the .glb files work on all of our devices (for now pixel 3, huawei mate x)
  • all the .gltf files do not work and throw a nasty error: https://pastebin.com/r0qeabSz

mariuspena avatar Mar 03 '21 16:03 mariuspena

I just try to open Airplane_None_Compressed_gltf.gltf on https://gltf-viewer.donmccurdy.com/ It opened without any problem Same with import it back on blender. Note that on blender, we got this info/warning. Maybe that some kind of stuff that Filament doesn't like: image

julienduroure avatar Mar 03 '21 17:03 julienduroure

I got a response here: https://github.com/google/filament/issues/3596#issuecomment-789895795 saying that is not a Filament issue :(

mariuspena avatar Mar 03 '21 17:03 mariuspena

It seems like there are really two questions here: errors with Draco-compressed model, and a different error with uncompressed .gltf (but not .glb) models. Is that correct? And, could you link to a .blend for testing? You can add .ZIP files to comments directly.


Draco

Those warnings are normal, Draco compression does often change the number of vertices in a model, which is fine. However, the comment from the other thread does worry me:

The glTF accessor wants 12680 vertices, but the decoded Draco mesh has 12684 vertices.

This exporter should be ensuring that the vertex count in the accessor matches the compressed data. Based on the warning logged I would assume that it does. So I'm surprised Filament reports that it does not. Unfortunately the glTF Validator cannot validate Draco-compressed data to tell us if it is correct. Access to the .blend might help.


Uncompressed

If a model passes the https://github.khronos.org/glTF-Validator/ test suite without any significant issues, and renders correctly in multiple viewers, but doesn't render in your application, then it's very likely a bug specific to that application or platform. As for the errors in https://pastebin.com/r0qeabSz I think that must be the case, I'm not familiar with the file loading process in Filament.

donmccurdy avatar Mar 03 '21 18:03 donmccurdy

The Filament team is continuing to get bug reports about this issue: https://github.com/google/filament/discussions/3815

According to the Draco extension spec:

Draco compression may change the order and number of vertices in a mesh. To satisfy the requirement that accessors properties be correct for both compressed and uncompressed data, generators should create uncompressed attributes and indices using data that has been decompressed from the Draco buffer, rather than the original source data.

prideout avatar Apr 16 '21 19:04 prideout

Hello, This ticket is quite old, and I am not sure what is the status, and if there are any issue in the glTF-Blender-IO addon. Without any answer (and simple test case), I will close this ticket in a week.

julienduroure avatar Jan 11 '23 14:01 julienduroure

Closing this ticket. Feel free to open a new one if you have still some issues!

julienduroure avatar Feb 09 '23 10:02 julienduroure