WebGPU pixel look: GPU colours the world, CPU only rare cells (t88 phase 2a)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-27 19:49:36 -04:00
co-authored by Claude Opus 5.5
parent b2c9ad9533
commit fc05146887
29 changed files with 949 additions and 386 deletions
+16
View File
@@ -4,6 +4,22 @@ What agents have done, newest first. Add an entry for every piece of work: the d
note or request it was for, what changed, the files touched, the tests run, and anything left
open or not verified. Keep each entry short; the git history has the details.
## 2026-10-27: t88 phase 2a, WebGPU pixel look (Claude Code + Codex)
- New `src/render/gpu/` (device, textures, colour compute, glow blur, draw) renders the pixel look
on a `#gpu` canvas under `#game`, which becomes a transparent overlay in WebGPU mode. The GPU
colours plain cells (background, materials with noise and grain, loose shade, fire, water,
ALPHA, digp shake, incandescence, lens, fog); the CPU colours only rare cells (built blocks,
screw/slope neighbours, bars, flyers, ghosts) through the extracted per-cell code
(`src/render/cell.js`, `src/render/objects.js`). World arrays upload per visible rectangle with
`queue.writeTexture`; light is still `computeLight` on the CPU, multiplied on the GPU.
`SET.renderer` = webgpu | legacy (Settings). The smooth look still uses the WebGL2 path.
- Screenshots legacy vs WebGPU: mean abs RGB error 0.112 / 0.062 / 0.034 at zoom 12/6/2, no pixel
off by more than 8. Factory scene drawWorld at zoom 2: 24.55 -> 9.98 ms (overrides 1.81, uploads
2.39, CPU light 5.59; GPU time 0.06 ms). Real loop zoom 2 CPU p50/p95: 31.7/35.3 -> 15.4/16.7 ms.
- Tests: `python3 test/run_all.py --browser` all passed (new `test/t_gpu.py`). Not checked:
Firefox WebGPU (no adapter in Playwright Firefox on Linux).
## 2026-10-27: t88 phase 1, serving and capability checks (Claude Code + Codex)
- The game must be served with COOP/COEP (README has nginx and Caddy lines; opening from disk is