Cloth simulation

On this page 8

Cloth simulation is the numerical computation of how a thin, flexible sheet of fabric moves, folds and drapes under gravity, wind, body motion and contact, so that garments, flags, curtains and sails behave believably on screen. Within 3D graphics & animation, it belongs to the family of physics-based techniques grouped under simulation & effects, next to rigid body, soft body, hair and fluid simulation.

Instead of keyframing every wrinkle by hand, an artist sets up a mesh, material properties and colliders, and a solver advances the cloth frame by frame. The result is usually written to a simulation cache so that lighting and rendering can use the motion without re-solving it.

How a cloth solver moves fabric

A cloth solver treats the garment as a network of point masses connected by constraints. Each vertex of the mesh carries a mass, a position and a velocity, and the edges and triangles between vertices define how far the fabric may stretch, shear and bend before it resists. At every time step the solver gathers external forces, predicts new positions, enforces the constraints and resolves collisions.

Two numerical families dominate production work. Mass-spring and finite-element models compute forces from material laws and integrate them, often with implicit integration that stays stable with stiff fabric. Position-based dynamics (PBD) and its successor XPBD project vertex positions directly onto constraints, which is fast, robust and easy to art-direct; the Vellum solver in Houdini is a well-known example of this approach.

The main stages of one solver step are summarized below.

StageWhat happensWhy it matters
Force accumulationGravity, wind, drag and force fields are appliedDrives the overall motion
PredictionVelocities update tentative vertex positionsProvides a starting guess
Constraint solvingStretch, shear and bend limits are enforced iterativelyGives fabric its character
Collision handlingCloth is pushed out of bodies and itselfPrevents interpenetration
Velocity updateCorrected positions define new velocities, damping is appliedControls energy and settling
Stages of a typical cloth solver step

Material parameters that define the fabric

The look of a simulated fabric comes mostly from a handful of stiffness, mass and damping values. Silk, denim and leather differ not in shape but in how strongly they resist stretching and bending and how quickly their motion dies down. Parameter names and units differ between applications, so artists usually tune by visual reference rather than by absolute numbers.

The following table lists the parameters found in almost every cloth system and their visible effect.

ParameterControlsRaising it produces
Stretch stiffnessResistance to elongation along the weaveLess rubbery, more woven fabric
Bend stiffnessResistance to foldingLarger, rounder folds like leather
Shear stiffnessResistance to diagonal distortionLess skewed, more stable panels
Mass or densityWeight per areaHeavier swing and more momentum
DampingLoss of energy per stepFaster settling, less jitter
FrictionSliding resistance on contactCloth clings instead of slipping
Collision thicknessDistance kept from surfacesFewer intersections, visible gap if too large
Core cloth parameters and their effect

Mesh resolution acts as a hidden parameter. A denser mesh produces finer wrinkles but needs more constraint iterations, and a stiffness value tuned at one resolution often looks different at another. For this reason, many studios lock the resolution early and tune materials afterward.

Collisions, substeps and stability

Collision handling is the hardest and most expensive part of cloth simulation. The solver must detect contact with colliders such as a character body, and it must detect self-collision where fabric touches itself in layered folds. Fast motion is dangerous because a vertex can move through a thin collider within a single frame, a failure known as tunneling.

Simulation substeps divide each frame into several smaller time steps, which reduces tunneling and makes stiff constraints converge. Typical productions use between 2 and 10 substeps per frame, with more for fast action and less for slow drapery. Increasing constraint iterations has a similar stiffening effect but does not cure tunneling, which is a common source of confusion.

Cloth simulation shares its mathematics with several neighboring techniques but targets a thin two-dimensional surface rather than a volume or a set of strands. The comparison below shows where the boundaries lie.

TechniqueSimulated objectTypical use
Cloth simulationThin sheet with stretch and bend constraintsGarments, flags, curtains, sails
Soft body simulationDeformable volumeJelly, muscles, inflatable objects
Hair simulationChains of one-dimensional strandsHair, fur, ropes, grass
Rigid body simulationUndeformable solidsFalling props, debris
Pattern-based garment toolsSewn panels draped on an avatarCostume design and digital fashion
Cloth simulation and neighboring techniques

Garment design tools such as Marvelous Designer start from flat sewing patterns and drape them on a figure, which makes them ideal for creating clothing. General-purpose solvers in Houdini, Blender, Maya nCloth or tyFlow are stronger for animated shots and effects, so many pipelines model the garment in a pattern tool and simulate the shot in a general solver.

Setting up a cloth shot in production

A reliable setup starts with a clean, evenly triangulated mesh without overlapping polygons, plus a simplified collision proxy for the body. Pinned or attached vertices hold the waistband, collar or flagpole edge, and a pre-roll of several dozen frames lets the garment settle from its modeled pose before the shot begins.

The decision table below summarizes common situations and practical choices.

SituationRecommended approachReason
Fast martial arts moveMore substeps and thicker collisionPrevents tunneling through limbs
Layered costumeSimulate inner layer first, then outerSimplifies self-collision
Crowd of background extrasLow resolution cloth or baked loopsKeeps cost manageable
Hero close-upHigh-resolution mesh and wrinkle mapsShows fine fabric detail
Real-time game characterSimple GPU cloth with few constraintsMust fit a frame budget
Practical choices for typical cloth shots

Finished simulations are written to a cache on disk, often as Alembic or VDB-compatible geometry sequences. Caching separates the expensive solve from lighting, allows non-destructive fixes with sculpt or blend layers and keeps render farms from re-simulating the same motion.

Limitations and common mistakes

Cloth solvers approximate real textiles, so they share recognizable failure modes. Most problems trace back to scale, mesh quality or time stepping rather than to the solver itself.

  • Wrong scene scale makes a coat behave like a handkerchief, because gravity and stiffness assume real-world units.
  • Interpenetration at the start frame causes explosions as the solver pushes vertices apart violently.
  • Excessive damping removes jitter but also makes fabric look slow and underwater.
  • Stretchy, rubbery cloth usually means too few iterations or substeps, not too low stiffness.
  • Long solve times grow quickly with self-collision, so artists test at low resolution first.

In simple terms

Cloth simulation lets a computer work out how fabric moves instead of an animator drawing every fold. The fabric is treated like a fine net of tiny weights tied together with stretchy threads. When the character walks or the wind blows, the computer calculates how each weight is pushed and pulled.

The artist decides how heavy and stiff the fabric is, what it may touch and how long to wait for it to settle. The key idea is simple: set up the rules, then let physics create the folds.

A practical example

An effects artist on an animated feature must simulate a long wool cape on a hero who leaps from a rooftop. The cape mesh has about 20,000 triangles, it is pinned at the shoulders and it collides with a low-polygon proxy of the body. A pre-roll of 40 frames lets the cape settle before the jump begins.

The first test shows the cape passing through the hero’s arm during the fast landing. The artist raises the solver from 3 to 8 substeps and increases collision thickness slightly, which removes the tunneling. Bend stiffness is raised to give the wool heavier, rounder folds.

The final solve runs overnight and is written to a cache. Lighting artists render the shot the next morning, and the director approves the cape motion without a single hand-animated fold.