Here's the plan for the simulation: - **Volcano**: a dark basalt cone drawn as a filled polygon with a crater notch, stratified shading, and an inner glowing crater mouth. Ground plane and gradient sky behind it. - **Pressure system**: pressure climbs steadily toward 100%; when full, an eruption fires lava bombs + ash burst, then pressure drops and slowly rebuilds for the next cycle. - **Lava physics**: particles get varied velocity from the crater, follow gravity with air drag, collide against the slope (a heightfield function of x), bounce/roll downhill proportional to local slope, cool through a color ramp (white-hot → yellow → orange → red → dark rock → fade), and are removed once cold and nearly still. - **Ash**: soft smoke puffs spawning at the crater, buoyant upward drift plus horizontal wind, expanding radius, fading alpha. - **Sliders**: eruption power, wind (negative = left, positive = right), and particle budget per eruption — all live. - **HUD**: live active-particle count and FPS via frame timing; particle-cap logic keeps the frame budget smooth well above 1000 particles. ```html Volcano — Pressure Cycles

CONTROLS

ERUPTION POWER
WIND ← / →
PARTICLE AMOUNT
0 particles
0 fps
PRESSURE
``` **How it works:** - **Pressure meter**: pressure rises ~1.4%/s; at 100% the meter flashes full and an eruption triggers, firing `s3.value` particles over ~1.5s at velocity scaled by the power slider. Pressure resets and rebuilds. - **Lava arcs & slopes**: particles fly with gravity, then a heightfield `slopeH(x)` supplies collision. Local slope normal is used to reflect velocity (damped bounce) plus a downhill tangential push, so bombs land on the cone and roll/slide down the flanks, settling or cooling out. - **Cooling ramp**: `heat` decays per-second through a 7-stop palette (white-hot → yellow → orange → red → dark rock) with additive-blend halos for the hottest particles. - **Ash**: crater-spawned puffs with buoyant upward drift and horizontal wind coupling, expanding radius and fading alpha, drifting with the wind slider's sign. - **Performance**: fixed-pool arrays with swap-remove (zero allocation per frame), a 2200 lava cap and 600 ash cap, single canvas pass per layer — comfortably smooth past 1000 live particles on typical machines.