Rust voxel sandbox (wgpu + wasm + axum multiplayer)
Find a file
Maximus Gorog accbf67bf2 Phase 2: shader decomposition + Rust-shared constants
shader.wgsl restructured:
  - Section headers: Camera → Sky horizon → Atmosphere extras → Terrain
    lighting decomposition → Pipelines.
  - sky_dome() is now the single source of truth for the horizon→zenith
    mix; sky_color() builds on it instead of duplicating the gradient.
  - fs_main decomposed into named helpers:
      ambient_term(n, sun, day)    hemisphere ambient via sky_dome lookup
      direct_sun_term(n, sun)      Lambert × visibility ramp
      leaf_jitter(world_pos)       per-pixel canopy variation
      fog_factor(dist)             0..1 fog ramp
      apply_fog(lit, dist, view)   defers sky_color call until needed
  - Camera.misc renamed to Camera.frame with named accessors
    scene_time() / eye_world() so callsites read intent.
  - DAY_PERIOD / SUN_OFFSET REMOVED from the shader — injected at the
    top by shader_source::wgsl_constants_header(). One source of truth
    in sim::lighting now drives both Rust and WGSL; mob burn and
    visible sun direction can never disagree.

New src/shader_source.rs:
  - wgsl_constants_header()  Rust → WGSL constants prelude
  - terrain_shader_source()  header + shader.wgsl, used at Renderer::new
  - post_shader_source()     pass-through

state.rs CameraUniform:
  - misc → frame to match the renamed WGSL field
  - Renderer uses the assembled shader source instead of include_str! directly

Tests: 53 passing (added 2 shader_source assembly tests). Native build,
wasm release build, server build all green.
2026-05-23 23:15:25 -06:00
server pre-alpha 0.0.1 — initial multiplayer voxel sandbox 2026-05-22 23:33:47 -06:00
src Phase 2: shader decomposition + Rust-shared constants 2026-05-23 23:15:25 -06:00
web Render + UI polish since pre-alpha-0.0.1 2026-05-23 18:44:56 -06:00
.dockerignore Add Docker + Caddy deploy for voxel.mxvs.art 2026-05-23 18:45:05 -06:00
.gitignore pre-alpha 0.0.1 — initial multiplayer voxel sandbox 2026-05-22 23:33:47 -06:00
build-web.sh pre-alpha 0.0.1 — initial multiplayer voxel sandbox 2026-05-22 23:33:47 -06:00
Caddyfile Add Docker + Caddy deploy for voxel.mxvs.art 2026-05-23 18:45:05 -06:00
Cargo.lock pre-alpha 0.0.1 — initial multiplayer voxel sandbox 2026-05-22 23:33:47 -06:00
Cargo.toml pre-alpha 0.0.1 — initial multiplayer voxel sandbox 2026-05-22 23:33:47 -06:00
DEPLOY.md DEPLOY.md: add active-deployment runbook for voxel.mxvs.art 2026-05-23 22:52:43 -06:00
docker-compose.prod.yml Add Docker + Caddy deploy for voxel.mxvs.art 2026-05-23 18:45:05 -06:00
docker-compose.yml Add Docker + Caddy deploy for voxel.mxvs.art 2026-05-23 18:45:05 -06:00
Dockerfile Add Docker + Caddy deploy for voxel.mxvs.art 2026-05-23 18:45:05 -06:00
run.sh pre-alpha 0.0.1 — initial multiplayer voxel sandbox 2026-05-22 23:33:47 -06:00