Creating Blend Shapes for Facial Animation in Games
This article outlines the complete process of creating blend shapes—also known as morph targets—for facial animation in game development. It covers everything from preparing the initial base mesh and sculpting individual expressions to exporting the final assets and integrating them into modern game engines like Unreal Engine and Unity.
1. Preparing the Base Mesh and Topology
The foundation of high-quality facial animation is a clean base mesh. Before sculpting any expressions, the 3D model must have proper topology.
- Edge Loops: Ensure the topology follows the natural muscle groups of the face, specifically around the eyes (orbicularis oculi) and the mouth (orbicularis oris).
- Vertex Count: The vertex count and vertex IDs must remain identical across all blend shapes. Adding or deleting a single vertex will break the morph target system.
- Neutral Pose: Start with a neutral facial expression with the mouth slightly open and eyes in a relaxed, half-open state to make deformation easier.
2. Sculpting the Target Shapes (Expressions)
Once the base mesh is ready, you duplicate it to create the individual target shapes. Each duplicate is modified to represent a specific facial movement.
- FACS Standard: Many game studios use the Facial Action Coding System (FACS) as a guide. This system breaks down facial movements into individual Action Units (AUs), such as “brow lowerer” or “lip corner puller.”
- Isolating Movements: Create highly localized shapes (e.g., left eyebrow up, right eyebrow up) rather than full-face emotions. This allows the game engine to combine individual shapes to create thousands of unique, dynamic expressions.
- Sculpting Tools: Use tools like Blender, Autodesk Maya, or ZBrush to deform the geometry. Remember to only move existing vertices; do not use tools that alter the mesh structure.
3. Setting Up the Blend Shape Nodes
After sculpting the expressions, you must link the target meshes back to the original base mesh within your 3D creation software.
- In Maya, this is done using the Blend Shape Deformer.
- In Blender, these are managed via Shape Keys in the Mesh Properties panel.
- Once linked, you can delete the duplicated target meshes to keep the scene clean, as the deformation data is stored inside the base mesh’s history.
- Test the setup by adjusting the sliders from 0 (neutral) to 1 (fully deformed) to ensure the transitions look natural and do not cause clipping.
4. Exporting to the Game Engine
To bring the blend shapes into a game engine, the model must be exported correctly.
- Format: Use the FBX format, which widely supports blend shape data.
- Export Settings: In your 3D software’s FBX export options, ensure that Animation and Deformers (specifically Blend Shapes or Morph Targets) are checked.
- Skeletal Binding: If the character also uses a skeletal rig for body movement, ensure the skin cluster weights are exported alongside the blend shapes.
5. Integration and Animation in the Game Engine
Once imported into a game engine like Unreal Engine or Unity, the blend shapes are ready to be driven by animation data.
- Import Settings: Upon importing the FBX, ensure the “Import Morph Targets” or “Import Blend Shapes” option is enabled in the engine’s import settings.
- Driving the Shapes: Blend shapes can be animated in
several ways:
- Timeline Curves: Traditional keyframe animation curves can drive the 0-to-1 values.
- Performance Capture: Live link technologies (such as Apple’s ARKit) can map real-time facial capture data directly to the corresponding blend shape channels.
- Code/Blueprints: Programmers can dynamically adjust shape values via scripts to react to in-game events, such as a character showing pain when taking damage.