Smoothed-particle hydrodynamics (SPH) is a meshless, Lagrangian method for simulating fluids in which the liquid is represented by moving particles that each carry mass, velocity and density, and every physical quantity is computed by blending neighboring particles with a smoothing kernel. In 3D graphics & animation, SPH belongs to the Simulation & effects toolkit alongside grid-based and hybrid solvers, and it is used for splashes, viscous goo, lava, mud and any liquid that breaks into many small pieces.
The method was introduced in 1977 for astrophysics, where it modeled gas clouds and stellar collisions, and it later moved into engineering and visual effects. Its appeal for artists is that particles go wherever the fluid goes, so no fixed simulation box limits the motion and thin sheets, droplets and free surfaces arise naturally.
How SPH turns particles into a fluid
SPH approximates a continuous fluid by sampling it at particle positions and reconstructing any field, such as density or pressure, as a weighted sum over neighbors. Each particle looks at others within its smoothing length h, a radius typically set to about two to four times the particle spacing, and the kernel function gives closer neighbors more influence than distant ones.
A simulation step usually follows the same sequence. The solver first runs a neighbor search, commonly with a uniform spatial hash grid, then computes each particle’s density from the masses around it. An equation of state converts the density error into pressure, and pressure gradients, viscosity, surface tension and external forces such as gravity are summed into an acceleration. Finally, the integrator updates velocities and positions and resolves collisions with colliders.
The table below lists the core quantities that an SPH solver tracks and what each one controls in the final look.
| Quantity | Role in the solver | Visible effect |
|---|---|---|
| Smoothing length | Radius of the kernel neighborhood | Detail level and smoothness |
| Rest density | Target density the fluid tries to keep | Overall volume of the liquid |
| Stiffness | Scales pressure from density error | Compressibility and bounciness |
| Viscosity | Damps relative velocity between neighbors | Water versus honey behavior |
| Surface tension | Pulls surface particles together | Droplet formation and thin strands |
| Time step | Length of one integration step | Stability and simulation speed |
Kernels and pressure solvers in SPH
The choice of kernel and pressure solver decides how stable, how incompressible and how fast an SPH simulation is. Kernels are smooth, bell-shaped functions with compact support, meaning they fall to zero at the smoothing length, which keeps the neighbor count bounded at roughly 30 to 60 neighbors in 3D.
Early graphics solvers used a weakly compressible formulation (WCSPH), which computes pressure directly from density with a stiff equation of state. It is simple but needs very small time steps to avoid visible bouncing and volume loss. Modern solvers enforce incompressibility iteratively and allow far larger steps.
| Solver | How pressure is found | Typical trade-off |
|---|---|---|
| WCSPH | Direct equation of state | Simple, but tiny time steps |
| PCISPH | Predict density, correct pressure iteratively | Larger steps, moderate cost |
| IISPH | Implicit pressure equation solved by iteration | Stable, low compression error |
| DFSPH | Separate divergence and density corrections | Fast and nearly incompressible |
| Position based fluids | Density constraints on positions | Robust for games, less physical |
In practice, the density error tolerance of an iterative solver, often set between 0.1 and 1 percent, is the most direct control over how much the liquid visibly compresses under its own weight.
SPH compared with grid and hybrid fluid methods
SPH is one of three families used for fluid simulation in production: purely particle-based methods, grid-based Eulerian methods and hybrid particle-grid methods such as FLIP. Each family stores the fluid differently, which shapes what it does well.
Grid solvers measure fluid properties at fixed cells, so incompressibility is enforced precisely, but small details below the cell size are lost. FLIP fluid carries particles through a grid, combining grid pressure accuracy with particle detail, and it dominates large water shots. SPH avoids the grid entirely, which suits unbounded domains and strongly viscous materials.
| Method | Fluid representation | Strengths | Weaknesses |
|---|---|---|---|
| SPH | Particles only | No domain limits, natural splashes | Noisy surfaces, costly neighbors |
| Eulerian grid | Values on fixed cells | Accurate pressure, smoke and fire | Bounded domain, numerical dissipation |
| FLIP or APIC | Particles advected through a grid | Detail plus accurate pressure | Grid memory, domain bounds |
| Position based fluids | Particles with constraints | Fast and stable in real time | Less physically accurate |
For smoke and fire simulation, grid methods remain the standard, because gases fill space continuously and do not benefit from tracking a free surface with particles.
Using SPH in 3D production
SPH is most useful when a shot needs free-flowing liquid with no fixed bounds or materials whose behavior depends on strong viscosity and cohesion. It appears in dedicated plug-ins, in physics engines for games and in research tools, and several general particle systems implement SPH-style density forces for blobs and goo.
The following decision table summarizes situations where SPH is a good fit and where another solver is the better choice.
| Situation | Recommended approach | Reason |
|---|---|---|
| Viscous goo, mud or lava | SPH with high viscosity | Handles cohesion and stretching well |
| Liquid poured into open space | SPH | No simulation box to enlarge |
| Large ocean or river shot | FLIP or ocean simulation | Grid pressure scales better |
| Interactive liquid in a game | Position based fluids | Predictable cost and stability |
| Smoke, steam or fire | Eulerian grid | Gases fill volume continuously |
Because SPH output is a point cloud, a separate surface reconstruction step is needed before rendering. Artists convert particles into a signed distance field or mesh, apply smoothing and then render the surface; the simulation cache stores particle data so that meshing can be adjusted without rerunning the solver.
Limitations and common mistakes with SPH
The main weakness of SPH is that accuracy depends on particle count, and a believable liquid often needs millions of particles. Neighbor searches dominate the cost, and a sparse simulation produces lumpy, grainy surfaces even after meshing.
- Particle deficiency at boundaries causes particles near walls or the free surface to feel too few neighbors, which leads to sticking or clumping unless boundary particles or corrections are used.
- Tensile instability makes particles clump into pairs under negative pressure, producing an unnatural, string-like texture.
- Oversized time steps violate the CFL condition, so fast particles jump through colliders or the fluid explodes.
- Mismatched scene scale changes the effective gravity and viscosity, so a cup of water simulated at building scale looks slow and heavy.
- Too little substepping on fast collisions lets particles leak through thin geometry; simulation substeps fix this at higher cost.
A frequent misconception is that SPH is inherently more realistic than grid solvers. In fact, basic SPH is slightly compressible, and only careful solver settings bring its volume conservation close to that of a well-configured FLIP simulation.
A plain-language summary
Smoothed-particle hydrodynamics pretends that a liquid is made of a huge crowd of tiny balls. Each ball checks how crowded its neighborhood is. If too many balls are squeezed together, they push apart; if they drift too far, they pull back. Thickness and stickiness are added as extra rules.
Because the balls carry the liquid with them, the water can splash anywhere without hitting the edge of an invisible box. The key idea is that many simple particles following local rules together behave like a real fluid, and the computer later wraps a smooth surface around them so the result looks like liquid instead of sand.
An example from practice
A small studio produces a commercial in which thick caramel pours over a rotating chocolate bar and drips onto a plate. The team chooses an SPH solver because the caramel must stretch into long strands, fold over itself and pile up, behavior that depends on strong viscosity and cohesion.
The artist sets the particle spacing to 0.5 millimeters, which yields about four million particles for a six-second shot, and raises viscosity until the strands hold for roughly half a second before breaking. An iterative solver with a 0.5 percent density tolerance keeps the volume stable, and four substeps per frame prevent particles from passing through the rotating bar.
The particles are cached, converted into a smoothed mesh and rendered with a glossy subsurface material. The final shot shows continuous, glossy strands with no visible graininess, and the lighting team can adjust the meshing radius from the cache without rerunning the eight-hour simulation.