A standalone Tauri 2 + Rust + wgpu 29 example that runs a two-dimensional incompressible-fluid approximation entirely on the GPU.
The output window is a native wgpu surface. The control window is a separate Tauri WebView. There is no WebGL canvas in the render path.
npm install
npm run dev:metal
Automatic backend selection:
npm run dev
Other backend launchers:
npm run dev:vulkan
npm run dev:dx12
npm run dev:gl
Each simulation substep records this compute sequence:
Velocity, dye, and pressure use ping-pong textures. No field is copied through the CPU.
Eight Rgba16Float textures are maintained:
The controls can display the actual dye, velocity, pressure, divergence, or curl texture.
Simulation and output resolution are deliberately independent.
A 512² simulation can therefore be presented into a 4K or 8K output target. A 2048² fluid grid is available for high-end testing and allocates approximately 256 MiB across the eight simulation textures.
512²241WindowDyeOrbitThen inspect Velocity, Pressure, Divergence, and Curl to understand the solver.
src-tauri/src/
├── main.rs Tauri commands and native renderer window
├── renderer.rs wgpu resources, compute graph, render loop, diagnostics
├── compute.wgsl advection, curl, vorticity, pressure, projection, dye
└── present.wgsl field visualization, bloom, tone mapping, presentation
See FLUID-GUIDE.md for the theory and performance implications.