SaschaWillems / Vulkan-glTF-PBR

Physical based rendering with Vulkan using glTF 2.0 models
MIT License
961 stars 130 forks source link

Crashes when displaying multi animation glTF #22

Closed Peach1 closed 5 years ago

Peach1 commented 5 years ago

An assert fails when importing this low poly glTF model with multiple animations:

fox.gltf.zip

The same gltf works fine in other viewers: https://gltf-viewer.donmccurdy.com/

The glTF appears to parse correctly but it asserts and crashes with vertex buffer out of range before the glTF is rendered to the screen.

This project is one of the few C++ glTF viewers that displays animation, so I find it a very valuable reference for animated glTF implementation, is it possible to fix this import?

SaschaWillems commented 5 years ago

Thanks for letting me know. All the gltf files I tested only had one animation, and I wasn't able to test with files containing multiple animations.

I'll take a look at your sample and try to fix this.

Edit: It looks like this model does not use indices, and as such would have to be rendered without them. I'll check if that's feasible.

SaschaWillems commented 5 years ago

This was actually pretty trivial to fix. The app now also supports primitives without indices and then just renders them using their vertices.

The fox renders fine for me, and switching animations works fine too.