A real-time GPU ray-marched 3D fractal explorer written in Rust (wgpu + winit + egui), with a switchable voxel engine, progressive anti-aliasing, camera-path flythrough export, and high-resolution screenshot capture.
cargo run --release
- Distance-estimated ray marching in a WGSL fragment shader: soft shadows, 5-tap ambient occlusion, palette-driven two-tone surface coloring (orbit traps), fresnel rim light, distance fog, step-count glow, optional one-bounce reflections.
- Progressive anti-aliasing: while the camera is still, jittered samples are averaged into an HDR accumulation buffer — the image refines over time.
- Post pass: exposure → ACES tonemap → vignette → film grain/dither.
- Voxel engine (V): a compute shader bakes the current fractal into a packed occupancy grid (64³–384³, 4 cells per u32) over a few frames; a DDA traverser renders glowing cubes with face AO, voxel shadows, edge lines, and emissive cores.
- The background (nebula, stars, sun) is derived from the active palette so every scene stays color-coherent.
Mandelbulb (any power, plus Julia mode), Mandelbox (incl. negative scale), Menger Sponge, Sierpinski Tetrahedron, and Pseudo-Kleinian — with 9 tuned presets ("Classic Mandelbulb", "Molten Julia Bulb", "Mandelbox Citadel", "Kleinian Dreams", …).
| Input | Action |
|---|---|
| Right-mouse drag | look around |
W A S D / Q E |
fly / down / up |
Shift |
5× speed boost |
| Mouse wheel | adjust fly speed |
V |
toggle voxel engine |
O |
auto-orbit demo mode (optional power morphing) |
K |
drop a camera keyframe |
Space |
play / stop the camera path |
P / F12 |
high-res screenshot (up to 8K, supersampled) → ./screenshots |
R |
reset camera to preset |
Tab |
show / hide UI |
F1 / H |
help overlay |
Esc |
cancel export / stop playback / release mouse / quit |
Fly speed automatically scales with the CPU-evaluated distance to the fractal surface, so you can dive arbitrarily deep into crevices without overshooting.
Drop keyframes with K (Catmull-Rom interpolation, yaw unwrapping), set the
duration, then Camera Path → Export frames. Frames render offscreen at up to
8K with N accumulation samples each and save as PNGs. Make a video with:
ffmpeg -framerate 30 -i flythrough/frame_%05d.png -pix_fmt yuv420p flight.mp4
Paths can be saved/loaded as camera_path.json.
cargo test # headless shader validation + render smoke test
cargo test render_preset_previews -- --ignored # renders every preset to target/previews/
cargo test render_readme_shots -- --ignored # re-renders the images in assets/





