Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

broken (?) glTF model crashes Interface #239

Closed
JulianGro opened this issue Oct 29, 2022 · 7 comments · Fixed by #835
Closed

broken (?) glTF model crashes Interface #239

JulianGro opened this issue Oct 29, 2022 · 7 comments · Fixed by #835
Labels
bug Something isn't working glTF Issues related to glTF/glb file support help wanted Extra attention is needed

Comments

@JulianGro
Copy link
Member

Currently ReadyPlayerMe models seem to be damaged in some way, which crashes Interface.

Here is an example file:
635d84711260644e7e393e0b.glb.zip

The glTF validator shows an error which makes me think that the model is broken in some way.

"code": "ACCESSOR_VECTOR3_NON_UNIT",
"message": "Vector3 at accessor indices 792..794 is not of unit length: 0.7181633880296953.",
"severity": 0,
"pointer": "/meshes/8/primitives/0/attributes/NORMAL"
@JulianGro JulianGro added the bug Something isn't working label Oct 29, 2022
@daleglass
Copy link
Contributor

Backtrace:

0x00007ffff448cae9 in GLTFSerializer::buildGeometry (this=<optimized out>, hfmModel=..., mapping=..., url=...) at /usr/include/qt5/QtCore/qarraydata.h:62
62	       return reinterpret_cast<void *> (reinterpret_cast<uintptr_t>(this) + offset);
(gdb) bt
#0  0x00007ffff448cae9 in GLTFSerializer::buildGeometry (this=<optimized out>, hfmModel=..., mapping=..., url=...) at /usr/include/qt5/QtCore/qarraydata.h:62
#1  0x00007ffff44914b1 in GLTFSerializer::read (this=0x7ffa54209670, data=..., mapping=..., url=...)
    at /home/dale/git/vircadia/overte-master/libraries/model-serializers/src/GLTFSerializer.cpp:1708
#2  0x00007ffff623f4b1 in ModelLoader::load (this=this@entry=0x2c97c15c, data=..., mapping=..., url=..., webMediaType="model/gltf-binary")
    at /home/dale/git/vircadia/overte-master/libraries/model-networking/src/model-networking/ModelLoader.cpp:23
#3  0x00007ffff62323c3 in GeometryReader::run (this=0x2c97c150)
    at /home/dale/git/vircadia/overte-master/libraries/model-networking/src/model-networking/ModelCache.cpp:158
#4  0x00007ffff3ceb4f2 in QThreadPoolThread::run (this=0x15d844d0) at thread/qthreadpool.cpp:100
#5  0x00007ffff3ce8487 in QThreadPrivate::start (arg=0x15d844d0) at thread/qthread_unix.cpp:330
#6  0x00007fffef6af14d in start_thread (arg=<optimized out>) at pthread_create.c:442
#7  0x00007fffef730950 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

@Morgenstern29
Copy link

dude.zip
I downloaded a sample avatar which was causing a crash. I tried to download it from my server but got the same result.

@JulianGro
Copy link
Member Author

That dude.glb doesn't throw any errors. Just some seemingly small warnings:

{
    "uri": "dude.glb",
    "mimeType": "model/gltf-binary",
    "validatorVersion": "2.0.0-dev.3.8",
    "validatedAt": "2022-11-26T12:42:17.423Z",
    "issues": {
        "numErrors": 0,
        "numWarnings": 10,
        "numInfos": 0,
        "numHints": 0,
        "messages": [
            {
                "code": "NODE_SKINNED_MESH_NON_ROOT",
                "message": "Node with a skinned mesh is not root. Parent transforms will not affect a skinned mesh.",
                "severity": 1,
                "pointer": "/nodes/67"
            },
            {
                "code": "NODE_SKINNED_MESH_NON_ROOT",
                "message": "Node with a skinned mesh is not root. Parent transforms will not affect a skinned mesh.",
                "severity": 1,
                "pointer": "/nodes/68"
            },
            {
                "code": "NODE_SKINNED_MESH_NON_ROOT",
                "message": "Node with a skinned mesh is not root. Parent transforms will not affect a skinned mesh.",
                "severity": 1,
                "pointer": "/nodes/69"
            },
            {
                "code": "NODE_SKINNED_MESH_NON_ROOT",
                "message": "Node with a skinned mesh is not root. Parent transforms will not affect a skinned mesh.",
                "severity": 1,
                "pointer": "/nodes/70"
            },
            {
                "code": "NODE_SKINNED_MESH_NON_ROOT",
                "message": "Node with a skinned mesh is not root. Parent transforms will not affect a skinned mesh.",
                "severity": 1,
                "pointer": "/nodes/72"
            },
            {
                "code": "NODE_SKINNED_MESH_NON_ROOT",
                "message": "Node with a skinned mesh is not root. Parent transforms will not affect a skinned mesh.",
                "severity": 1,
                "pointer": "/nodes/73"
            },
            {
                "code": "NODE_SKINNED_MESH_NON_ROOT",
                "message": "Node with a skinned mesh is not root. Parent transforms will not affect a skinned mesh.",
                "severity": 1,
                "pointer": "/nodes/74"
            },
            {
                "code": "NODE_SKINNED_MESH_NON_ROOT",
                "message": "Node with a skinned mesh is not root. Parent transforms will not affect a skinned mesh.",
                "severity": 1,
                "pointer": "/nodes/75"
            },
            {
                "code": "NODE_SKINNED_MESH_NON_ROOT",
                "message": "Node with a skinned mesh is not root. Parent transforms will not affect a skinned mesh.",
                "severity": 1,
                "pointer": "/nodes/76"
            },
            {
                "code": "NODE_SKINNED_MESH_NON_ROOT",
                "message": "Node with a skinned mesh is not root. Parent transforms will not affect a skinned mesh.",
                "severity": 1,
                "pointer": "/nodes/77"
            }
        ],
        "truncated": false
    },

@daleglass
Copy link
Contributor

PR #263 fixed the crash, but the code remains broken.

The PR added a test for the glTF code, which runs through user-provided models and official Khronos samples. This seems to have narrowed the issue down. The following two samples fail:

https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/Fox
https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/RecursiveSkeletons

The last one is particularly interesting:

This model demonstrates tow things:

  • Reusing the same mesh multiple times by multiple skins.
  • Binding multiple skins to a single skeleton.

Each skin attaches the same mesh to different lengths of the skeletons, so we have 21 skins bound to multiple lengths of each skeleton.

Using skinning in this way might be seen by some as abusing the glTF format, but it's actually very useful in some circumstances, and can be used by game engines as a stress test on how to handle uncommon, -but valid- skinned meshes.

And is very likely the actual issue that needs fixing. Help from people familiar with rendering engines and glTF would be extremely appreciated here.

@daleglass daleglass added the help wanted Extra attention is needed label Nov 27, 2022
@JulianGro JulianGro added the glTF Issues related to glTF/glb file support label Aug 4, 2023
@AnotherFoxGuy
Copy link
Contributor

I've ran into this bug today, it seems to happen with every model that glTFast exports

Models that don't crash the interface are looking like this:
interface_2023-08-29_18-22-55

@Morgenstern29
Copy link

Morgenstern29 commented Sep 2, 2023

Yep, indeed, it is how RPM avatars looks in Vircadia if you just use avatar out of the box. You need to convert it in Blender to glb before uploading. Now Vircadia doesn't crash but RPM avatars still not work properly.

@ksuprynowicz
Copy link
Member

Fixed by #835

@JulianGro JulianGro linked a pull request Feb 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working glTF Issues related to glTF/glb file support help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants