I've been building a Rust + Vulkan game engine (Vulkano + winit). This is the Lorenz attractor with 1,000,000 particles that all start inside a cube 0.000001 wide.
How it works:
- Every particle follows the real Lorenz equations (sigma = 10, rho = 28, beta = 8/3).
- Plain f32 positions don't work here. Particles start about 1e-8 apart, but near the attractor one f32 step is about 2e-6, so a million particles collapse into a handful of points. Instead the CPU integrates one reference path in f64, and a GPU shader integrates each particle's tiny offset from it with RK4 (h = 0.005), using the exact difference f(r + d) - f(r).
- Color comes from each particle's starting position, so you can watch neighbors get pulled onto opposite wings. The two circled at the end started side by side.
- There are no interactions between particles, so the cost grows linearly with the count.
It's not real time: live it runs at 9 FPS with 1M particles on an RTX 3060. Most of the frame goes to per-entity CPU work in the engine, which is what I'm optimizing next. The video was rendered offscreen at 4K, and the camera zoom is scripted to follow the spread.
Source: lorenz_butterfly.rs (src/examples/lorenz_butterfly.rs)
Run it: cargo run --release --features window --example lorenz_butterfly -- --side 100