Rust voxel sandbox (wgpu + wasm + axum multiplayer)
You asked "Are you spawning too many godrays?" — yes, 32 samples per ¼-res pixel was overkill. Plus FXAA was a 5-tap blur at full res and the sun disc was pow(cos, 800) which is itself a slow op. shafts.wgsl: N_SAMPLES 32 → 16. DECAY + WEIGHT rebalanced to keep total intensity the same with half the samples. At ¼ res with a 16-step decay the rays still trace cleanly (no banding). Halves the god-rays fragment cost. post.wgsl: FXAA from 5-tap (NW/NE/SW/SE corners + center) to 2-tap (center + SE diagonal). Voxel-game edges are axis-aligned and high-contrast, so two-tap diagonal softening is enough to kill the staircase artifacts that motivated AA. 2.5× cheaper per pixel; full-screen fragment work goes from ~6 texture reads + math to ~3. shader.wgsl: Sun disc sharpness pow(cos, 800) → pow(cos, 256) at zenith, pow(cos, 160) → pow(cos, 120) at horizon. The disc still reads crisp visually, and pow on smaller exponents is materially faster on weak GPUs / software rasterizers. Moon disc + halo now gated behind night > 0.05 — invisible during the day anyway, so skipping the pow(cos, 256) saves work on every daytime sky pixel. render/mod.rs: Mask + shafts passes skipped at the CPU level when sun is below horizon (the shader was already returning black, but we paid pass setup + clear regardless). Replaced with a single "shafts clear" pass at night so the post pass doesn't see yesterday's rays. No features dropped. Tests: 63/63 passing. Wasm release built. |
||
|---|---|---|
| server | ||
| src | ||
| test | ||
| web | ||
| .dockerignore | ||
| .gitignore | ||
| ARCHITECTURE.md | ||
| build-web.sh | ||
| Caddyfile | ||
| Cargo.lock | ||
| Cargo.toml | ||
| DEPLOY.md | ||
| docker-compose.prod.yml | ||
| docker-compose.yml | ||
| Dockerfile | ||
| run.sh | ||