Page 4: Morphing (Blend Shapes)
Spring 2026 Sample Solution
Mesh morphing is a technique that is also known as blend shapes.
The idea is that we define multiple versions of the mesh, and then have each vertex compute its final position as a weighted average (blend). Effectively, each vertex has extra data that is a different version of the mesh. To animate the mesh, we simply change the amount that each mesh is weighted.
The advantage and disadvantage of morph-based animation are that it requires modeling many different versions of the mesh. This can be an advantage because an artist can create the different versions. Of course, there is a cost to creating and storing these different versions.
Morphing requires each version of the mesh to have the same number of vertices with the same connectivity. There needs to be a correspondence: each vertex must have a vertex on the other meshes that it blends with.
The different copies of the mesh are called morph targets.
Horse Morph Targets (Adapted From Three.js Example)
This horse example comes from the official three.js demonstration set. I have adapted it for better control.
The horse model is loaded from the open-source three.js examples asset set (Horse.glb from the three.js distribution). The glb file (a type of gltf file) stores the multiple copies of the mesh (and the animated motion) in the file.
As the horse animates, you can see how the weights of the different morph targets change. At any given time, two different meshes are being blended together. If you switch to manual mode, you can try mixing together the different poses in different ways. To make that easier, here is a picture of all 16 of the meshes used in the demo. You can see a live demo with these 16 different models at: horse-targets.html .
One base mesh and 15 morph targets of a horse. Taken from the three.js demos.
If you notice, we called the first mesh the base mesh. We often treat the first mesh differently, and store the other meshes as offsets from this first mesh.
Morphing Math
Morphing is simple: we have a weight vector (that is used for the entire object) w that specifies the amount of each mesh to use. Then, for each vertex, we simply take the weighted sum of all of the different meshes:
Note that if the weights don’t sum to 1, bad things can happen. Often, we build in some normalization to force w to sum to 1. One common approach: we set the weight of the base mesh to be one minus the sum of all the other meshes.
Here is a simple demo where we have a set of 2D shapes. The sliders can either be free (not constrained) or the base can be computed to make things sum to one.
One thing to notice: because we are using linear blending, it does not reproduce rotations when using targets that are rotated. This is extremely bad for the 180 degree rotation - the square collapses to a point at !
If you experiment with the sliders, you’ll see you can get a variety of different shapes by mixing the various blend shapes.
Offset Blendshape Form
In this demo, we use the base mesh, but then we store the other targets as offsets from the base.
This form allows free mixing without requiring the weights to sum to 1. It is a little easier for allowing arbitrary mixing of the different targets.
Morphing in Three.js
Three.js has morphing built in. The morph targets are provided as attribute buffers. In addition to the position attribute, you can define morphAttributes for different attributes.
Here is a simple version of the same 2D demo to show how this works in three.js. Note that because we didn’t want to split vertices, the colors are interpolated (so it doesn’t look like the previous versions).
The key step is that when we define the Geometry we add the additional blendshape targets. Note that we can blend many attributes, not just position (although, in this demo, we only blend positions).
|
|
You can see that this demo creates a geometry with the base mesh as the positions, and then creates an array of buffer geometries for the other morph targets.
To animate the mesh, we simply need to change the weights. In the demo, we change the values of the influences based on the sliders. After changing the influences, we need to redraw (similar to changing a transformation).
|
|
Morphing Summary
With morphing (also known as blend shapes), we blend between different copies of the mesh. It is implemented cleanly in three.js.
If you want more examples of morphing in three check out:
Mesh Animation Summary
We’ve seen three different approaches to animated meshes: deformations, skinning, and morphing. With all of the methods, we define the mesh at the beginning, add additional information, and update simplified control structures on each frame to move the mesh.
To compare:
| Vertex Animation | Deformation | Skinning | Morphing |
|---|---|---|---|
| Change many vertices each frame. | Change a few grid points or cage points. | Change the skeleton. | Change the blend weights |
| Update the entire mesh each frame | Send the mesh to the graphics memory once | Send the mesh to the graphics memory once | Send the mesh to the graphics memory once |
| Recompute the normals each frame | Deform the normals per vertex | Transform the normals per-vertex | Blend the normals per-vertex |