acdream/docs/superpowers/specs
Erik b35ddf3426 spec(N.5b): design for terrain on the modern rendering path
Brainstormed 2026-05-09. Lifts outdoor terrain rendering onto N.5's
modern primitives (bindless textures + glMultiDrawElementsIndirect)
preserving the visible terrain pixel-for-pixel and preserving
physics-vs-visual Z agreement (issue #51).

Key decisions:
- Path C: WB renderer pattern + acdream's existing LandblockMesh.Build
  (which uses retail's FSplitNESW formula, verified at retail addr
  00531d10). Path A killed by 49.98% measured divergence vs retail.
- Single global VBO/EBO + slot allocator (one slot per landblock),
  uint32 indices with baseVertex baked, mirror WB's pattern.
- Keep TerrainAtlas (palCode-based fragment blending), add bindless
  handles. No LandSurfaceManager adoption.
- Separate terrain_modern.vert/.frag (port of today's terrain.vert/.frag
  with bindless preamble; same blend math, same AdjustPlanes lighting).
- Pure-CPU Z-conformance sentinel: meshTriZ vs TerrainSurface within
  1mm across 10 representative landblocks x 100 sample points.
- Acceptance: build green, conformance test passes, ~6-8 GL calls/frame
  for terrain regardless of scene size, [TERRAIN-DIAG] cpu_ms at
  radius=5 >=10% lower than today's per-LB-binds path.

Files added: TerrainModernRenderer + TerrainSlotAllocator +
terrain_modern.vert/.frag + 2 test files.
Files deleted: TerrainChunkRenderer + TerrainRenderer +
terrain.vert/.frag.

Out of scope: EnvCells/dungeons, sky, particles, A.5 LOD,
LandSurfaceManager adoption, fork-patching WB.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 08:23:09 +02:00
..
2026-04-11-foundation-phase-design.md docs: refresh strategic roadmap + Foundation phase design spec 2026-04-11 21:43:33 +02:00
2026-04-12-b3-complete-movement-design.md docs(specs): Phase B.3 Complete — movement and world navigation design 2026-04-12 15:54:12 +02:00
2026-04-12-physics-collision-engine-design.md docs(specs): Phase B.3 — physics collision engine design 2026-04-12 09:42:31 +02:00
2026-04-12-player-movement-design.md docs(specs): Phase B.2 — player movement mode design 2026-04-12 14:05:07 +02:00
2026-04-13-movement-completion-design.md docs: movement completion design spec (B.2/B.3) 2026-04-13 23:01:18 +02:00
2026-05-02-l3-remote-entity-motion-design.md docs(spec): Phase L.3 scope revision — combine L.3.1+L.3.2 2026-05-03 10:03:09 +02:00
2026-05-08-phase-n-worldbuilder-migration-design.md spec(rendering): Phase N WorldBuilder migration design + N.1 scenery 2026-05-08 08:47:23 +02:00
2026-05-08-phase-n1-scenery-via-wb-helpers-design.md spec(rendering): Phase N WorldBuilder migration design + N.1 scenery 2026-05-08 08:47:23 +02:00
2026-05-08-phase-n4-rendering-foundation-design.md spec(N.4): rendering pipeline foundation design 2026-05-08 12:47:49 +02:00
2026-05-08-phase-n5-modern-rendering-design.md phase(N.5): retirement amendment — InstancedMeshRenderer + StaticMeshRenderer + WbFoundationFlag deleted 2026-05-08 22:01:36 +02:00
2026-05-09-phase-n5b-terrain-modern-design.md spec(N.5b): design for terrain on the modern rendering path 2026-05-09 08:23:09 +02:00