Particles that pile up: sand and grains
Particles that take up room: sand pouring into a heap, gravel, beads, a ball pit. Without a flow, or with Particle Physics in one.
Particles pass through each other unless they're told to bump. Bumping makes each one a small solid ball: they pour, roll, pile into heaps and push what's in their way.
Start from
The Sand starter: grains pouring from a spout into a heap that grows. It runs on the sidebar's settings, with the Collisions panel's Each Other on.
Without a flow: Each Other
In the Collisions panel, under Each Other:
- Each Other on: particles bump as balls of the Display panel's Sphere Radius, times their scale. That radius is now part of the simulation, so changing it needs a new bake.
- Friction is how much touching grains hold against sliding past each other. It's what lets a heap stand steep: the Sand starter uses 0.9. Low friction spreads into a puddle of marbles.
- Bounce: 0 for sand, more for balls that bounce off each other.
The ground's own Bounce and Friction count too: the starter has Bounce 0 and Friction 0.9, so grains land and stay.
In a flow: Particle Physics
In a flow, Particle Physics does the same, with more control:
- Radius: how big each grain bumps. Set the Display panel's Sphere Radius to the same, so what you see is what bumps.
- Friction: as above, for steep or flat heaps.
- Static Friction: how hard grains at rest hold before they slide. With it a heap keeps its slope and a pour builds a cone; set it above Friction (0.8 against 0.5, say). 0 is the older grip. With it, grains take extra substeps as they need them, settle and sleep once a heap stops, and pour from a spout as a tight stream.
- Rolling: with Static Friction, how hard grains resist rolling. 0.2 is round sand; more for angular grains and gravel, which stand steeper.
- Rest Below: grains that touch others and move slower than this stop, so a heap stands still instead of creeping and sagging.
- Density: how heavy grains are, in kg/m³ (dry sand is about 1600). It matters when they meet rigid bodies: heavier grains push bodies harder, and are pushed aside less.
- Rounds: how hard each step pushes overlaps apart. A tall heap that sinks into itself needs more, and more substeps.
- Cohesion: wet sand. Grains just apart pull together, so a heap stands steeper, a castle holds its walls, and a clod breaks off whole. Gap is how far apart (in radii) they still pull: 0.1 is a film of water between them.
Particles bump with those of every event with Particle Physics, so grains in two events (wet and dry, two colours) pile together.
How many grains
Real sand is far too fine to simulate grain by grain: a grain stands for a small clump. Halve the Radius and the same heap takes eight times the grains, and more substeps, so pick the biggest grain that still looks right at the camera's distance. Pour with a modest rate: the Sand starter's 30 a frame grows a heap quickly.
Ideas
- An hourglass: a closed glass mesh as the Collide's object, grains born All at Once in its top bulb.
- Tipping out of a bucket: the bucket as a collider, animated: grains slide out as it tilts. See Moving objects.
- Shapes: show grains as small rock models through the Display panel's Shapes, keeping Radius about their size.
- Two colours mixing: two events, each with its own Birth and Colour, and Particle Physics in both, so they pile together. (Two Births in one event won't do: every operator in an event acts on both Births' particles.)
What goes wrong
- Grains sit half sunk into a container. Bumping grains meet a mesh collider at their centres; only the Ground holds them up by their radius. Use the Ground for floors; for walls, collide with a hidden copy of the container shrunk inward by a grain's radius.
- The heap slumps flat. Friction too low, or Rest Below at 0. Static Friction above Friction keeps a heap's slope.
- Grains jitter or the heap sinks. Too few Rounds or substeps for the heap's height.
- The bake slows down as the heap grows. It's the count: every grain stays (Lifespan is off in the starter). Use bigger grains or pour fewer. With Static Friction, a fast pour also takes extra substeps: drop it from lower, or use bigger grains.
- Grains roll away across the floor. Raise Rolling, or the Ground's friction.
Related
Snow, rain and confetti
Things that fall through the air: snow drifting in the wind, rain streaking down and splashing, confetti tumbling in many colours.
Flocks and schools
Birds, fish and swarms that steer together: Flock's settings one by one, swerving round obstacles, keeping level, and shapes that face where they go.