Watch a cloak billow in a modern game, a rope bridge sag under a hero's boots, or a sandbag squash
when it lands — the odds are overwhelming that none of it was simulated with textbook physics. The
textbook way is to sum up forces, turn them into accelerations, and
In 2007 Müller and colleagues published a gloriously pragmatic escape hatch called Position-Based Dynamics (PBD). Its trick: stop reasoning about forces altogether. Work directly with positions. Guess where each particle wants to go, then simply move the positions until they satisfy the rules you care about ("stay this far apart", "keep this volume") — nudging each one the smallest distance it takes. The result is unconditionally stable, fast, and endlessly controllable, which is exactly why it, and its refinement XPBD, now runs the cloth, ropes, soft bodies, sand and even fluids in a huge slice of real-time graphics.
A PBD step for a system of particles has three beats. First predict: ignore all the
constraints for a moment and let each particle fly under gravity alone, giving a tentative predicted
position
Notice what is missing: nowhere do we compute a spring force, a stiffness matrix, or an acceleration due to a constraint. The constraints act by editing positions, and the velocities are inferred afterwards. That inversion — positions first, velocities as a consequence — is the whole philosophy, and the reason the method behaves so calmly.
The single most useful constraint stitches two particles together at a fixed
rest length
Right now the two predicted positions are some distance
Sanity-check the split. The two corrections point opposite ways along
One projection sweep rarely satisfies every constraint at once — fixing edge A slightly breaks edge B its particle also belongs to. So PBD just repeats the sweep. Solving all the constraints one after another, reusing the freshly-updated positions as you go, is exactly Gauss–Seidel iteration. The more sweeps you run per frame, the more thoroughly the constraints are enforced, and the stiffer the material feels: two iterations give a loose, stretchy cloth; twenty give a taut, canvas-like one.
That is a wonderfully simple stiffness dial — but it is also PBD's original sin. "Stiffness = number of iterations" is not a physical quantity. The same cloth with the same iteration count feels different if you change the timestep or the mesh resolution, because each of those changes how much a single sweep accomplishes. Your art director tunes a beautiful drape at 30 fps; someone bumps the game to 60 fps and the cloth mysteriously goes limp. The stiffness was never really a property of the fabric — it was an artefact of the solver.
The trap: in original PBD, apparent stiffness is a function of iteration count and timestep (and mesh resolution), not a physical parameter. Halve the timestep — say you raise the frame rate from 30 to 60 fps — and a cloth tuned at the old rate gets softer and stretchier, because each frame now advances less and the same number of sweeps over-relaxes less relative to the motion. A material that changes personality when you change the frame rate is a bug waiting to ship.
The fix is XPBD (extended, or compliant, PBD, Macklin et al. 2016),
which adds a compliance term
XPBD keeps the entire predict–project–update loop but rewrites the correction so it remembers a real
stiffness. Each constraint carries a compliance
The
Below is a live PBD rope: a chain of particles, the top one pinned, each joined to its neighbour by a distance constraint, all falling under gravity and settling into a hanging curve. Drag the iterations slider. At one iteration the constraints are barely enforced — the rope stretches long and rubbery, sagging well past its rest length. Crank the iterations up and each frame does many more Gauss–Seidel sweeps, the links snap toward their true lengths, and the rope stiffens into a taut, nearly inextensible cord. Same particles, same masses, same gravity — the only change is how hard the solver works.
This is precisely the effect the "Watch out!" warns about, made tangible: stiffness you can turn with an iteration knob. It is fast and stable and looks great — it just isn't a physical constant, which is the gap XPBD closes.
A force-based integrator can inject energy: a stiff spring stretched a hair produces a huge force, which over a finite timestep can overshoot to a larger stretch, a bigger force, and a runaway blow-up. PBD structurally cannot do this. Projection only ever moves a position toward satisfying a constraint — it pulls the configuration onto the valid set, never flinging it further out. It cannot add unbounded energy, so no matter how stiff the material or how large the timestep, the simulation stays bounded.
The catch, and it is an honest one: PBD is not physically accurate. It gives you motion that is plausible and controllable, not a faithful solution of the equations of motion. The effective stiffness in plain PBD isn't a real material constant; damping is implicit and a bit fuzzy; energy is not conserved exactly. For a film-quality engineering simulation you would reach for a proper implicit solver. For a game that must run 60 times a second and never explode, PBD's bargain — give up exactness, gain rock-solid stability and speed — is almost always the right trade. That is why it is everywhere.
Change the constraints, keep the loop. Cloth is a grid of distance constraints (plus bending ones between opposite triangles). A rope is a single chain of them. Soft bodies add volume- and shape-matching constraints so a squashed blob springs back. Sand and rigid piles use contact and friction constraints between grains. Fluids — the celebrated Position-Based Fluids — impose a density constraint on each particle so the "water" stays incompressible. Every one of these is the identical predict–project–update skeleton with a different bag of constraints projected in the middle. NVIDIA's FleX engine leans on exactly this unification to simulate cloth, rigids, fluids and granular sand in one solver, all talking to each other through shared contacts.
Controllability. An animator often wants to cheat physics — a cape that reads clearly on camera, a hero's cloth that never clips or distracts. Because PBD constraints are just position edits, you can bolt on art-directed constraints (attach this vertex to that bone, forbid self-intersection, gently pull the silhouette toward a sketch) alongside the physical ones, all solved by the same forgiving Gauss–Seidel sweep. "Plausible and directable" often beats "accurate and stubborn" when a shot has to hit a specific look on a deadline.