Files
sunrise/docs/superpowers/plans/2026-10-30-prebuilt-buildings.md

15 lines
1.7 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Prebuilt buildings implementation plan
**Goal:** Load precomputed building geometry and illumination without changing appearance.
**Architecture:** Keep the existing generator for offline preparation and experiments. Share material/shader/update logic with a small binary loader. Store exact typed arrays, indices, light pixels, bounds, counts and target; reject stale artifacts at build time using source hashes. No new dependencies or geometry compression.
- [x] Add equivalence and loader tests, confirm failure before implementation.
- [x] Extract shared scene and light-texture restoration; add binary loading and offline generation.
- [x] Switch main/world to baked assets; preserve experiment generator API.
- [x] Generate assets, check exact equivalence and stale-file rejection, run tests/build and preview.
- [x] Document regeneration and measured sizes, review resource handling.
Verification: original and restored position/normal/light-height/index arrays, bounding volumes, counts, target, material colors, spill pixels/bounds and night/dawn/day intensity match exactly. Browser midnight/noon views render with no console errors. 44 tests pass; production build passes with the existing bundle-size warning. Independent review found source hash sensitivity to checkout line endings; normalized CRLF to LF for text inputs and verified both remain fresh while changed content is rejected.
Output: 10,028,176-byte binary (8,979,600 geometry + 1,048,576 light pixels) plus JSON metadata. Local Node assembly-only timings across 3 runs: generation 571.72–786.20ms, restoration 0.14–0.40ms; excludes download, parsing, GPU upload, other scene work. No total-load-time or FPS claim.