Rust voxel sandbox (wgpu + wasm + axum multiplayer)
Find a file
Maximus Gorog bd6b3fadb0 Round B: screen-space god rays + FXAA (#12, #14)
New WGSL files:
  mask.wgsl     Sun-cone × sky-alpha mask at ¼ resolution. Marks sky
                pixels (scene_color.a == 0) that fall within a tight
                cone around the sun direction. Sun direction derived
                from scene time via the injected DAY_PERIOD /
                SUN_OFFSET constants — same source as sim::lighting,
                so visual rays align with the mechanical sun.
  shafts.wgsl   Radial blur at ¼ resolution. Projects the sun
                direction-at-infinity to screen space via view_proj,
                steps 32 samples from each pixel toward the
                sun_screen_pos accumulating mask intensity with
                exponential decay, outputs sun-tinted ray color.

shader.wgsl:
  - fs_sky now writes alpha = 0 so the mask pass can identify sky
    pixels without a separate occluder pass. Terrain / outline /
    remote-player pipelines continue writing alpha = 1.

post.wgsl (rewritten):
  - Reads scene_color + shafts.
  - Cheap edge-aware FXAA (5-tap diagonal blur, blends toward neighbor
    average where luminance gradient exceeds threshold). Catches the
    axis-aligned staircase aliasing that voxel games produce.
  - Adds shafts additively before tonemap so rays go through the
    filmic curve and don't blow out.

render/scene_target.rs:
  - create_image_bind_group (single texture + sampler) — used by
    mask pass (binds scene_color) and shafts pass (binds mask_view).
  - create_composite_bind_group (scene + shafts + sampler) — used by
    the final post pass.
  - create_quarter_res_view (¹⁄₁₆ fillrate, RENDER_ATTACHMENT +
    TEXTURE_BINDING) — used for both mask and shafts targets.

render/pipelines.rs:
  - image_bgl / composite_bgl as separate layouts.
  - fullscreen_pipeline factory replaces the post-specific one;
    takes vs/fs entry-point names so mask, shafts, and post all
    build through the same shape.

render/mod.rs:
  - Renderer grows mask_view, shafts_view, image_bgl, composite_bgl,
    mask_pipeline, shafts_pipeline, mask_bg, shafts_bg fields. The
    old single-pass post_pipeline becomes the final composite pass.
  - render() now does scene → mask → shafts → post (each in its own
    encoder block).
  - resize() recreates all three render targets and all three bind
    groups in the right order.

Tests: 63 passing (added 2 for mask/shafts source assembly). Native
+ wasm release clean.

Visual change: when you face roughly toward the sun and there's
geometry blocking the disc, you'll see warm light shafts radiating
outward. FXAA softens the worst pixel-step edges. Tonemap (from
Round A) is now the final step of the new pipeline.
2026-05-24 10:09:10 -06:00
server pre-alpha 0.0.1 — initial multiplayer voxel sandbox 2026-05-22 23:33:47 -06:00
src Round B: screen-space god rays + FXAA (#12, #14) 2026-05-24 10:09:10 -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
ARCHITECTURE.md Add ARCHITECTURE.md mapping the functional-core/imperative-shell split 2026-05-23 23:33:02 -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