Loading glTF morph targets data
Similar to the recipe Importing skeleton and animation data, this one doesn’t include a standalone example either. Instead, it focuses on the modifications needed in our glTF loading code to load morph target data from glTF files using the Assimp library.
Getting ready
Refer to the recipe Importing skeleton and animation data for a quick refresher on the data structures needed to support animations. You can also review the recipe Doing skeletal animations in compute shaders and the shader code in data/shaders/gltf/animation.comp to revisit our animation compute shader.
How to do it…
To load morph targets from glTF files, we will need to add some new data structures and update the loading code. Let’s go through how to do this.
- We begin, as usual, with the data structures.
MorphTargetrepresents a reference for all morph targets attached to a specific mesh. All morph targets are stored in a single buffer...