Skeletal Animation / Skinned Animation


What is Skeletal / Skinned Animation?

Skeletal / Skinned animation is an animation technique that uses two parts:

For example, the skeleton is highlighted in green in the following picture (from Google Images), and the mesh is the human wearing armor.

How does it work?

Skeletal animation works by creating 'transformation matrices' which dictate how each bone in the skeleton moves depending on the frame of animation.

Each vertex on the mesh is assigned a 'weighted' value per bone (10 bones in a skeleton would mean 10 weighted values per vertex).

Each weight signifies how much the vertex is affected by changes in the corresponding bone. A vertex in a leg might have a weighted value of .8 for a leg bone, .3 for a hip bone, and a weighted value of 0 for a neck bone, since the neck moves independently from the leg.

The transformation matrix of each bone is scaled by the corresponding weight of the vertex before being applied to the vertex itself. All of the changes from all relevant bones is calculated and added up before the vertex's final position is found.

Optimizing the Process

This process of recalculating the location of every vertex is a heavy burden on the CPU so it is done on the GPU to maximize efficiency. It can be further optimized by only looping through the above equation with any bones that don't have a 'non-zero' weight for the relevant vertex.

This is done by selecting out the non-zero weights along with their corresponding bone index, and moving them to the front of the arrays being sent to the GPU. The number of relevant bones is also sent to the GPU so it knows how many loops to iterate through.

Working with Assimp

Assimp is one library that helps read in mesh and animation data for OpenGL.

Though I was unable to get animation working in the end, I was able to get Assimp to render meshes.

The general process with animating meshes in Assimp is the same as the process detailed above. Assimp merely helps parse information and help store it.

The mesh (obtained here) in the picture above was rendered with the Assimp Library .