Rust voxel sandbox (wgpu + wasm + axum multiplayer)
You called out vibes-based programming — fair. This adds the actual
measurement substrate so the next change can be data-driven instead
of educated-guess driven.
app.rs:
- tick's frame_dt was previously clamped to 100ms (for physics
safety: a 1-second hang shouldn't teleport the player). That
clamp was poisoning the FPS telemetry: anything slower than
10 fps reported as exactly 10 fps. Now physics gets the clamped
dt; the FPS HUD reads the unclamped elapsed_ms so we see the
real frame time even at 3 fps.
bridges.rs:
- New BenchFlags { disable_shafts, disable_post }, exposed via
wasm_api as bench_set_disable_shafts(bool) /
bench_set_disable_post(bool). Set from JS console or scenario:
window.voxel_game.bench_set_disable_shafts(true)
render/mod.rs:
- render() consults the flags. Truly skipped (no clear, no work)
so the bench measures the pure cost of each pass.
Usage from a player's perspective:
1. Open the game, watch the FPS HUD (top-right).
2. F12 → Console
3. window.voxel_game.bench_set_disable_shafts(true)
watch HUD — fps should jump if shafts were expensive.
4. window.voxel_game.bench_set_disable_post(true)
— measures FXAA + composite + tonemap cost.
5. Both true — naked terrain only, no post effects.
The Playwright-launched Chromium I have access to is software-
rasterizing at ~3 fps which makes per-pass deltas indistinguishable
from noise. On real hardware the cost differences should be clear.
I won't push more "optimizations" until we have real-hardware data
on which pass is actually costing what.
No features removed. Tests: 63/63 passing. Wasm built clean.
|
||
|---|---|---|
| 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 | ||