Soft Body Deformation and Elastic Rebound in Games
Simulating elastic rebound and deformation in squishy, soft-body game characters requires a balance between physical accuracy and real-time computational performance. Developers rely on several techniques ranging from full volumetric physics engines to lightweight skeletal and shader approximations. This article explores the primary methods used in modern game development to achieve realistic squash, stretch, and jiggle effects, including Position-Based Dynamics, Mass-Spring systems, Finite Element Methods, skeletal physics rigs, and vertex shaders.
Mass-Spring-Damper Systems
The mass-spring model is one of the classic approaches to soft-body simulation. A character's 3D mesh is represented as a network of point masses interconnected by virtual springs and dampers. When an external force, such as an impact or acceleration, moves a mass, adjacent springs stretch or compress and apply restoring forces to return the mesh to its rest state. The dampers absorb energy over time to simulate internal material friction and prevent endless bouncing. While relatively simple to implement, basic mass-spring systems can suffer from numerical instability if the springs are too stiff or the frame rate fluctuates.
Position-Based Dynamics (PBD) and Extended PBD (XPBD)
Position-Based Dynamics has largely superseded traditional force-based mass-spring systems in modern real-time game engines. Instead of calculating forces and accelerations, PBD directly modifies vertex positions to satisfy specific geometric constraints, such as distance between vertices, bending limits, and volume conservation.
Extended Position-Based Dynamics (XPBD) refines this by decoupling constraint stiffness from the simulation time step, allowing for predictable and stable elastic behavior regardless of frame rate. XPBD is widely used for squishy characters because it prevents the mesh from exploding or collapsing, easily handles collisions, and naturally supports volume preservation constraints that make soft bodies look full rather than hollow.
Finite Element Method (FEM)
For applications requiring high physical realism—such as medical simulations or cinematic character interactions—the Finite Element Method is the gold standard. FEM divides the character’s internal volume into a 3D mesh of volumetric elements, usually tetrahedra. Continuum mechanics equations are applied to calculate stress and strain throughout the entire volume.
Because FEM calculates energy distribution through true volumetric deformation, it produces highly realistic organic tissue behavior and non-linear elasticity. However, it is computationally intensive, typically requiring precomputation, simplified collision proxies, or GPU acceleration to run in real-time games.
Skeletal Jiggle Bones and Spring Constraints
When full-mesh simulation is too resource-heavy, developers use physics-driven skeletal hierarchies. Often referred to as "spring bones" or "jiggle bones," this technique attaches dynamic physics constraints to secondary bones within a character's animation rig.
When the primary character moves or stops, these secondary bones react via spring math, oscillating and dragging behind before settling. The underlying skin weights blend the movement smoothly across the mesh. This method is exceptionally cheap computationally, scales well across various hardware platforms, and allows animators to manually limit or tune deformation directly within standard authoring tools.
Blend Shapes Driven by Physics
Another hybrid method combines artistic control with dynamic movement by using pre-sculpted morph targets (blend shapes) for squashing and stretching. The game engine monitors character variables—such as vertical velocity, acceleration, or impact forces from raycasts—and dynamically drives the weight of these blend shapes. When a character lands on the ground, an impact-detection script increases the weight of a "squash" morph target and rapidly transitions to a "rebound" stretch target using a damped harmonic oscillator curve. This guarantees visually pleasing silhouettes without relying on freeform mesh deformation.
Vertex Shader Displacements
For stylized or lightweight squishy effects, deformation can be offloaded entirely to the GPU via vertex shaders or World Position Offset (WPO). The shader uses mathematical functions, such as sine waves, or reads dynamic data (like collision points and impact vectors passed from gameplay scripts) to offset vertices in real time. Because this occurs directly on the graphics card without updating CPU-side collision hulls, it introduces virtually no physics overhead, making it ideal for rendering dozens of squishy background characters or simple slime-like entities simultaneously.