Rust voxel sandbox (wgpu + wasm + axum multiplayer)
state.rs is now 870 lines (down from 1700+). All GPU code moved to a
dedicated render/ module.
New src/render/:
mod.rs Renderer struct + impl with all methods; the only
place that owns wgpu device/surface/pipelines. The
wasm-only WebGPU probe + compat-error overlay live
here as a private wasm_compat sub-module.
pipelines.rs Pipeline factory functions: camera_bgl, post_bgl,
pipeline_layout, sky_pipeline, terrain_pipeline,
outline_pipeline, post_pipeline. Each takes
device + shader + format and returns a configured
wgpu::RenderPipeline — pure factories, no hidden
state.
scene_target.rs create_depth_view, create_scene_color_view,
create_post_bind_group — fresh-resource builders
called from Renderer::new and Renderer::resize.
uniform.rs CameraUniform (matches WGSL camera.frame layout),
OutlineVertex, ChunkBuffers.
state.rs:
- drops ~760 lines of pipeline + scene-target plumbing
- imports Renderer from crate::render
- keeps App + tick + drain_net_inbox + thread_locals + wasm_api
Tests: 53/53 pass. Native + wasm release build clean.
|
||
|---|---|---|
| server | ||
| src | ||
| web | ||
| .dockerignore | ||
| .gitignore | ||
| build-web.sh | ||
| Caddyfile | ||
| Cargo.lock | ||
| Cargo.toml | ||
| DEPLOY.md | ||
| docker-compose.prod.yml | ||
| docker-compose.yml | ||
| Dockerfile | ||
| run.sh | ||