Web template: adopt session-evolved features + render-on-demand everywhere

Ported from the test3d-5 session build: in-page variant switching, share
link (full state in URL hash), auto tour, toast, building-grouped floor
toggles, per-(floor,category) geometry merge (draw calls), progressive
overview->standard loading. Hardened during the port: {{BUILD}} placeholder
restored (Date.now() defeated caching), single-GLB deployments skip the
phantom overview.glb phase, building-group fallback now derives from
floor-key prefixes (assemble_campus convention) instead of a hardcoded "A"
test, bookmarks completed (list + restore + remove + hash persistence).

Render-on-demand lands in BOTH the template and the offline viewer: static
scenes rendered at 60fps pegged the GPU/fans for identical frames —
invalidate()-driven rendering + shadowMap.autoUpdate=false (bake per
change). 27号 measured: template web 0 frames over 3s idle, offline viewer
25 frames total through load; features browser-verified (tour, bookmarks,
hash restore), zero console errors. window.__renders is the diagnostic
counter — idle growth must be 0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-04 12:55:03 +08:00
parent eb7eea2861
commit 23cf3af678
6 changed files with 757 additions and 114 deletions

View File

@@ -104,6 +104,7 @@ The pipeline is designed so a first pass either succeeds or STOPS at a loud gate
- Use Blender MCP only after the CLI artifact exists, for inspection, scene tuning, or interactive refinement.
6. Generate the Web showcase.
- The template renders ON DEMAND (static scene + 60fps loop = pegged GPU/fans for identical frames): anything that changes the view calls invalidate(); shadows are baked per change (`shadowMap.autoUpdate=false`), and `window.__renders` is the diagnostic frame counter — idle MUST read 0 growth. The offline viewer follows the same contract. Template features: building-grouped floor toggles (metadata.buildings or floor-key prefix fallback), per-(floor,category) geometry merging (draw-call reduction), progressive overview->standard loading (single-GLB deployments skip the swap), in-page variant switching, auto tour, camera bookmarks (list + restore + removable), share-link (full state in the URL hash), toast notices.
- For digital-twin-style Web delivery, keep generated slabs visible by default and create three filtered specs/models:
- `overview`: walls, glazing, roof, columns, beams, and generated slabs.
- `standard`: overview plus railings and doors; use this as the default Web model.