A small real‑time fluid simulation and renderer written in Rust. It uses SPH‑style particle simulation and renders either instanced cubes or an extracted surface via a marching‑cubes compute shader.
- Rendering:
glium+winit - UI:
egui - Math:
nalgebra_glm - Surface extraction: GLSL compute shader (OpenGL 4.3+) with a CPU compatibility fallback for systems limited to OpenGL 4.1
- Rust (stable)
- GPU/driver with OpenGL 4.3 or newer for the full GPU compute path
- OpenGL 4.1 systems such as Apple silicon Macs run a CPU compatibility path
- Debug:
cargo run - Release:
cargo run --release
- Movement:
W / A / S / D,Space(up),Left Ctrl(down) - Mouse: look control when enabled (see UI panel)
- UI is shown on the left (Egui)
- Simulation parameters: kernel radius, particle mass, gas constant, rest density, viscosity, iso level
- Draw mode:
Draw cubeson: instanced particlesDraw cubesoff: surface via marching cubes- Surface options: wireframe, color, alpha, (optional) debug points
- Bounds controls: position, rotation, scale;
Draw boundstoggle
- On Apple silicon/macOS, the app falls back to CPU simulation and CPU marching cubes because macOS OpenGL stops at 4.1 and does not expose compute shaders.
- If surface is invisible, try adjusting
iso leveland checkDraw boundsto verify the simulation domain.