feat(render): implement Campaign AR and terrain fidelity

This commit is contained in:
Erik 2026-08-22 13:13:29 +02:00
parent 99cf26e00c
commit 7a5f96ede5
368 changed files with 50611 additions and 950 deletions

View file

@ -1797,7 +1797,15 @@ tool run closes it).
## #392 — A refused/failed fullscreen enter leaves `fullscreen: true` persisted against a windowed client
**Status:** OPEN — filed 2026-08-13 from the #376/#388 blast review (M4).
**Status:** DONE — 2026-08-22. `IRuntimeDisplayWindowTarget` now returns
the observed native fullscreen post-condition. Both startup and live-save
controllers reconcile that result back through their own storage boundary,
so a refused/failed enter immediately restores `fullscreen: false` in the
retained Config row and `settings.json`; a failed leave likewise preserves
the true native state. Focused startup, target, persistence, and observer
tests pin the result seam and the requested→applied publication contract.
**Original filing:**
The save path persists the Full Screen flag BEFORE the apply runs; when
the state-aware apply then refuses (mode not offered / catalog absent) or
the native switch fails, the client stays windowed while settings.json and
@ -6869,7 +6877,14 @@ it. Do #297 FIRST — #298 depends on it.
`#153` closed 2026-07-30 on the AD-30 hold + arrival StopCompletely +
canonical outbound + reveal-barrier evidence chain). TS-50/TS-51/TS-53 are
tracked in the divergence register.
- **Deferred visual fidelity:** `#226` retail landscape detail overlay.
- **Resolved visual fidelity (2026-08-21):** `#226` implements retail's
building/EnvCell detail overlay through the existing Building Detail
Textures preference. The reachable retail `ChangeRegion` caller disables
landscape detail, so no separate landscape-detail item remains queued.
The same Track A closeout ports retail's incident-face-averaged shared
terrain vertex normals without changing positions, indices, or collision;
terrain subdivision was rejected because quantized source samples cannot
recover detail and the retail-correct normal interpolation is now present.
- **Deferred frame-pacing fidelity:** `#235`, capped/RDP jump presentation
aliases the retail 30 Hz object clock; uncapped Release presentation is
smooth and physics, collision, and wire state remain correct.
@ -9190,42 +9205,67 @@ the full 6,558-pass / 5-skip suite remains green.
---
## #226 — Retail landscape detail-texture overlay is not rendered
## #226 — Retail building/EnvCell detail-texture overlay is not rendered
**Status:** OPEN — deferred visual fidelity; the user-visible tiling regression
in #155 is fixed
**Status:** IMPLEMENTED + CONNECTED-VISUAL-VERIFIED 2026-08-21
**Severity:** LOW
**Filed:** 2026-07-20
**Component:** rendering / terrain material
**Component:** rendering / building and environment materials
**Description:** Retail can overlay a high-frequency landscape detail texture,
faded by viewer distance and gated by the Environment Detail Textures setting.
acdream now repeats every base/overlay/road surface at its authored
`TerrainTex.TexTiling`, which fixed the stretched/blurry symptom in #155, but
does not yet render this separate optional detail layer.
**Description:** Retail overlays a category-scoped detail texture on building
shells and interior/EnvCell geometry, faded by viewer distance and gated by
the Building Detail Textures preference. acdream's existing “Building
Detail Textures” checkbox persisted that preference but previously had no
renderer consumer. Outdoor landscape detail is forced off by the reachable
Sept-2013 retail preference caller and is not this issue's user-visible target.
**Root cause / status:** The earlier #155 investigation conflated two retail
mechanisms. `bb5acab9` ported the behavior that produced the observed mismatch:
`TexMerge::CopyAndTile`/`Merge` pass each source's authored base tiling into the
terrain composition. The still-missing detail pass is a distinct
`LScape::GenerateDetailSurfaces`/`ACRender::landPolyDraw` path. The first
experimental detail-array implementation sampled the wrong neutral/data
contract and was reverted rather than shipping a darkened ground. TS-52 records
the current divergence.
terrain composition. #226 now resolves Dereth category 1/2 detail surfaces,
uploads their authored texture/tiling with retail wrap/linear sampling, and
replays building and EnvCell built-mesh subsets with the exact
`DESTCOLOR + INVSRCALPHA` blend. This includes opaque, ClipMap, straight-alpha,
additive, and inverse-alpha material subsets; transparent base/detail commands
remain adjacent in acdream's authoritative shared alpha order with depth writes
disabled (retail bypasses delayed alpha while detail is installed; retaining
the accepted queue is the registered bounded ordering seam). The existing
persisted checkbox is read at draw time. Opaque object replay is restricted to
coalesced command runs containing a building, with mixed commands filtered per
instance in the shader. Its depth-equal, non-A2C overlay inherits the exact
per-sample coverage written by the opaque/A2C base, including ClipMap edges.
Ordinary objects and landscape remain excluded; the base pass is untouched
when the option is off. The first experimental
landscape array used the wrong target, topology, neutral point, and blend and
was reverted rather than shipping a darkened ground.
**Files:** `src/AcDream.App/Rendering/TerrainAtlas.cs`;
`src/AcDream.App/Rendering/TerrainModernRenderer.cs`;
`src/AcDream.App/Rendering/Shaders/terrain_modern.frag`.
`src/AcDream.App/Rendering/Wb/WbDrawDispatcher.Rhi.cs`;
`src/AcDream.App/Rendering/Wb/EnvCellRenderer.Rhi.cs`;
`src/AcDream.App/Rendering/Shaders/mesh_detail.vert`;
`src/AcDream.App/Rendering/Shaders/mesh_detail.frag`.
**Research:** `docs/research/2026-07-13-retail-terrain-texture-tiling-pseudocode.md`
covers the now-shipped base contract. The detail symbols cited above must be
distilled into a dedicated pseudocode note as the first #226 implementation
step; the reverted experiment remains available in git history.
covers the already-shipped base contract. The dedicated, corrected detail
contract is `docs/research/2026-08-21-retail-building-detail-texturing-pseudocode.md`;
its evidence source is
`docs/research/2026-08-21-terrain-and-atmospheric-rendering-findings.md`.
**Acceptance:** With retail Environment Detail Textures enabled, close ground
shows the same high-frequency detail and distance fade without changing base
color/brightness. Disabling it produces the already-accepted authored base
tiling.
**Acceptance:** Toggling the existing “Building Detail Textures” checkbox
visibly changes nearby building and interior surfaces without a restart.
Enabled detail is full through 10 m positive view depth, fades linearly to an
exact no-op at 50 m, and preserves retail's measured slight brightening.
Disabling it submits no detail replay and preserves the already-accepted base
render. Landscape, ordinary objects, physics, and collision remain unchanged.
The automated gates cover the setting gate, data/blend/fade contract,
built-mesh subset eligibility, opaque command filtering and A2C coverage,
transparent depth/order seam, Vulkan descriptor
binding and total/per-stage storage-descriptor limits, shader artifacts, and
build. The connected Facility Hub A/B/A gate applied the real Config checkbox
on -> off -> restored-on: nearby static walls/floor changed immediately, the
restored frame returned to the original-on image (right-wall RGB MAE 2.132
on/off versus 0.007 on/restored), the persisted preference was observed false
during B and restored true, and logout was ACE-confirmed graceful.
---
@ -12052,9 +12092,11 @@ field through `TerrainAtlas`, uploads a layer-indexed table, and applies it in
the modern shader while leaving cell-scale alpha masks unchanged. The user
confirmed the outdoor textures now match the expected scale.
The optional high-frequency Environment Detail Textures pass is a different
retail mechanism. It remains deferred under #226/TS-52 and does not keep this
fixed user-visible regression open.
The high-frequency detail pass is a different retail mechanism. #226 completed
its reachable user-visible target on 2026-08-21: building shells and EnvCell
geometry. Retail's reachable `ChangeRegion` caller passes zero landscape-detail
surfaces, so the former TS-52 landscape premise is retired and does not keep
this fixed user-visible regression open.
**Files:** `src/AcDream.App/Rendering/TerrainAtlas.cs`;
`src/AcDream.App/Rendering/TerrainModernRenderer.cs`;