Real-Time Avalanche Simulation

devvisualizationsimulationwebgpu

Developed during my master's degree (TU Wien, Visual Computing). A physically based snow avalanche simulation with the Moving Least Squares Material Point Method (MLS-MPM), running in real time on the GPU inside weBIGeo, in the browser.

The Hintertux avalanche (AvaFrame’s avaHit release area) simulated on weBIGeo’s terrain, played in real time.

Try it

What it is

weBIGeo is a research project of TU Wien based on AlpineMaps.org. It shows that large geographic datasets can be processed and visualized in the browser in near real time with WebGPU. This project adds a physically based avalanche simulation to its compute graph: a stored avalanche is released and simulated live on the map, nothing is precomputed.

The simulation uses MLS-MPM, a particle-grid method that the film industry uses for snow. Three snow material models can be switched at runtime (Stomakhin et al., Drucker-Prager and Cohesive Cam Clay, with seven presets from the avalanche literature), the basal friction is Coulomb or Voellmy, and the flow picks up the snow cover along its path (entrainment).

How it runs in real time

The solver runs in 12 WGSL compute kernels; particle and grid data stay on the GPU. Two decisions make real time possible over a whole avalanche path:

On an Apple M5, 65 536 particles take 6.4 ms of GPU time per 24 substeps, about 70× real time. Even a million particles still run at about 4.5× real time.

Rendering

The avalanche is drawn into weBIGeo’s G-buffer, so it is lit and hazed like the terrain: as particles (spheres, strain-rate ellipsoids or transparent powder), as a continuous flow surface draped over the terrain, with the avalanche track and the remaining snow cover, or as a 2D density overlay.

Compared with a real avalanche model

The scenarios are AvaFrame’s five real test avalanches (Kontertal, Gallreide, Hintertux, Wolfsgruben, Madlein). In a sandbox mode the MPM runs on AvaFrame’s own terrain with AvaFrame’s release areas, next to the result of com1DFA, the model used in avalanche practice. Rated with AvaFrame’s AIMEC tool over 75 runs, the best MPM variants reach com1DFA’s runout within about 100 m, closer than the data-driven models compared. Their flows, however, run 2–2.5× faster than com1DFA’s.

Limits

At real-time scale the grid cells are 5–12.5 m, far coarser than the 0.5 m of offline avalanche studies. A released slab of about 1 m is thinner than one cell, so the flow reads more fluid than slab-like. The comparison is against another model, not against observed avalanches. This is a visualization and research project, not a tool for hazard assessment.

The code and its documentation were written with Claude (Anthropic) through Claude Code, directed and reviewed by me.