metalrain-gpu-tests
๐ฌ What Is This?
Metalrain GPU Tests is an interactive visualization of a GPU-accelerated falling sand simulation engine. Watch 20+ physics scenarios run in real-time, testing everything from basic particle physics to complex ecosystems.
This isn't a game—it's a window into a physics engine. Each test validates a specific behavior: fire spreading through wood, water cycling through phase transitions, plants competing for light and water, and more.
โจ Features
๐ฎ Interactive Viewing
- Navigate between tests with Page Up/Down
- Pause/Resume with Spacebar
- Restart any test with Left Arrow
- Watch validation progress in real-time
๐งช 20+ Physics Scenarios
| Category | What You'll See |
|---|---|
| Basic Physics | Sand falling, powder stacking, density-based layering |
| Reactions | Fire spreading through wood, lava meeting water, acid dissolving metal, gunpowder explosions |
| Phase Transitions | Ice melting, water boiling to steam, steam condensing (rain!), lava cooling to rock |
| Fluid Dynamics | Liquids leveling, multi-fluid interactions, oil floating on water |
| Organic Growth | Seeds germinating, plants growing toward light, roots seeking water, ecosystem competition |
โก GPU-Powered
- All physics computed in parallel via WebGPU compute shaders
- Hexagonal grid simulation for natural liquid flow
- Temperature propagation, wind systems, and material reactions
๐ Highlight Scenarios
๐ฅ Fire Spreads
Watch fire consume wood, creating charcoal and ash. Temperature propagates realistically—materials ignite when hot enough.
๐ง Water Phase Cycle
A complete water cycle: cold water falls onto a hot finned heatsink, boils to steam, rises to the ceiling cooler, condenses back to rain, and repeats.
๐ฑ Ecosystem
Multiple plant varieties compete around a central water pool. Grass and ferns on one bank, oak and pine trees on the other. Watch roots grow toward water, stems reach for light, and leaves emerge.
๐ฅ Gunpowder Ignites
A line of gunpowder meets a heat source. The resulting chain reaction demonstrates pressure propagation and combustion physics.
๐ฅ๏ธ Requirements
- WebGPU-capable browser (Chrome 113+, Edge 113+, or Firefox with flags)
- Modern GPU with WebGPU support
- Desktop recommended (keyboard controls)
๐ Controls
| Key | Action |
|---|---|
| Space | Pause/Resume simulation |
| Page Up | Previous test |
| Page Down | Next test |
| Left Arrow | Restart current test |
| Escape | Quit (native only) |
๐ ๏ธ About Metalrain
This is the test suite for Metalrain, a GPU-accelerated falling sand engine written in Rust using wgpu. The engine features:
- Modular WGSL compute shaders composed via naga_oil
- Hexagonal grid for natural fluid dynamics
- Temperature, wind, and pressure systems
- Organic growth simulation (plants, trees, ecosystems)
- Full material reaction system
๐ Technical Notes
Each scenario has validation criteria shown in the side panel. Green checkmarks indicate physics behaving correctly. This is an automated test suite that happens to make for an interesting visualization.
The simulation runs entirely on your GPU. Frame rate depends on your graphics card and the complexity of the current scenario.
| Updated | 18 days ago |
| Status | Released |
| Platforms | HTML5, Windows |
| Author | metalraindev |
| Tags | cellular-automata, falling-sand, gpu, physics-simulation, rust, Sandbox, tech-demo, wasm |
Download
Development log
- Porting Metalrain to WebAssembly35 days ago
- Devlog #1: Building a Visual Test Harness for GPU Physics36 days ago

Leave a comment
Log in with itch.io to leave a comment.