From 0718bb55186c51b35793ebd7e2530e35c9d4a6cd Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 9 May 2026 00:23:36 +0100 Subject: [PATCH] Fix temporal control background coverage --- src/Aquarium.Engine/Render/Shaders/Aquarium.hlsl | 3 ++- state/evidence.jsonl | 1 + state/memory.json | 1 + state/scratch.md | 3 ++- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Aquarium.Engine/Render/Shaders/Aquarium.hlsl b/src/Aquarium.Engine/Render/Shaders/Aquarium.hlsl index 7f53b38..346fcd2 100644 --- a/src/Aquarium.Engine/Render/Shaders/Aquarium.hlsl +++ b/src/Aquarium.Engine/Render/Shaders/Aquarium.hlsl @@ -1311,7 +1311,7 @@ SceneOut AquariumScenePS(VertexOut input) float outputMaterialId = 0.0; float3 outputNormal = 0.0; float outputReactive = 0.0; - float outputCoverage = 1.0; + float outputCoverage = 0.0; float outputMediumOpacity = 0.0; if (raymarchBodies(cameraPosition, rayDirection, hitPosition, materialId, primitiveId, travel)) @@ -1323,6 +1323,7 @@ SceneOut AquariumScenePS(VertexOut input) outputTravel = travel; outputMaterialId = primitiveId == 0 ? FIELD_ID_SELF : FIELD_ID_PLANET_BASE + (float)(primitiveId - 1); outputNormal = normal; + outputCoverage = 1.0; } float3 gridHitPosition; diff --git a/state/evidence.jsonl b/state/evidence.jsonl index b5f9c5f..7b25d8c 100644 --- a/state/evidence.jsonl +++ b/state/evidence.jsonl @@ -36,3 +36,4 @@ {"area":"dev-loop/reload","lesson":"Live runtime reload must be end-to-end acknowledged. dev-watch now treats live-current.txt as a request, not success: after building a live slot and updating the pointer, it waits for the running host stdout to report the exact live DLL path or marks the reload failed. Visible dev windows can use dev-watch -ReopenWhenClosed to reopen the last good slot without rebuilding after the window is closed.","files":["scripts/dev-watch.ps1","README.md","state/map.yaml","state/memory.json","state/scratch.md"],"verification":["dotnet build Aquarium.Engine.slnx",".\\scripts\\dev-watch.ps1 -NoInitialLaunch -Once -IntervalMilliseconds 10 -DebounceMilliseconds 10 -RetainSlots 4",".\\scripts\\dev-reload.ps1 -Headless -RetainSlots 4"],"ts":"2026-05-08"} {"area":"dev-loop/reload","lesson":"dev-watch was not reaching its poll loop because Start-Process -Wait around dev-reload could remain attached to the long-lived launched Aquarium process after initial launch. The watcher now invokes dev-reload synchronously, leaving app process ownership inside dev-reload, and a live-only Aquarium.Engine.Live cosmetic change produced a live slot plus host acknowledgement without rebuilding the host.","files":["scripts/dev-watch.ps1","src/Aquarium.Engine.Live/AquariumRuntime.cs","state/memory.json","state/scratch.md"],"verification":["watch.log: Live reload requested, pointer updated, and acknowledged for artifacts/dev-reload/live-slots/20260509-000855-c3f6310c/Aquarium.Engine.Live.dll","latest.out.log: Live reload probe armed and Live runtime reload applied"],"ts":"2026-05-09"} {"area":"renderer/debug","lesson":"Temporal debug modes now expose the resolver's control data directly. Modes 5 and 6 show current temporal control channels and current field identity, so Grid support, reactive strength, medium opacity, and field ownership can be inspected without inferring them from final color or history artifacts.","files":["src/Aquarium.Engine/Render/Shaders/Aquarium.hlsl","src/Aquarium.Engine/Render/D3D11Renderer.cs","src/Aquarium.Engine/Render/DirectWriteOverlay.cs","src/Aquarium.Engine/AquariumHost.cs","src/Aquarium.Engine/Platform/Win32Window.cs","src/Aquarium.Engine.Contracts/Input/InputState.cs","docs/tsr-inspired-taa-spec.md","docs/hlsl-renderer.md","state/memory.json","state/scratch.md"],"verification":["dotnet build Aquarium.Engine.slnx","Shader hot reload applied after Grid reactive channel fix","Mode 5 screenshot showed stale full-Grid reactive red; Grid reactive now zero and support remains coverage"],"ts":"2026-05-09"} +{"area":"renderer/debug","lesson":"Temporal control coverage now distinguishes empty background from stable surfaces. Background pixels default coverage to zero, opaque body hits write coverage 1, and Grid hits write line/support coverage; mode 5 should therefore show black empty background rather than green covered history everywhere.","files":["src/Aquarium.Engine/Render/Shaders/Aquarium.hlsl","state/memory.json","state/scratch.md"],"verification":["Shader hot reload applied with no stderr after control coverage fix"],"ts":"2026-05-09"} diff --git a/state/memory.json b/state/memory.json index c39cd84..5a0829e 100644 --- a/state/memory.json +++ b/state/memory.json @@ -61,6 +61,7 @@ "Grid TAA must not use the raw stochastic hit/miss scene color as the current radiance truth. The resolve should reconstruct analytic Grid overlay color at the current world hit and use premultiplied color as the current estimate, then use history for stability rather than reconstructing alpha from binary noise alone.", "For the current Grid renderer, final Grid color should not blend previous color history. Use analytic current Grid color for the final pixel and write it into history; keep history age/weight/debug as diagnostics until a real transparent/volumetric composition contract needs color history again.", "Grid temporal control coverage is the line/support signal. Do not mark the whole low-support Grid surface reactive; that turns debug control mode red everywhere and reintroduces stale history-murder logic.", + "Temporal control background coverage must be zero. Opaque hits can write coverage 1, and Grid hits write line/support coverage; empty background must not appear as stable covered history in mode 5.", "Projection jitter is currently scaled to zero. If Self or planet surfaces visibly judder, the resolve is not hiding jitter and the correct live choice is no jitter until opaque and Grid paths both prove stable.", "Temporal debug views are live keys: F1 cycles, 0 final, 1 raw current scene, 2 reprojected history, 3 history age, 4 history weight, 5 current temporal control, 6 current field identity. Use these before guessing whether TAA is sampling, validating, or presenting the wrong signal.", "Bruneton-style atmospheric scattering is the later sky/planet solution, not the first Grid fog pass. Use LUTs, explicit texture mappings, and unit-tested physical terms when Aquarium reaches ground-to-space atmosphere.", diff --git a/state/scratch.md b/state/scratch.md index 6367c15..ffe92e4 100644 --- a/state/scratch.md +++ b/state/scratch.md @@ -96,7 +96,8 @@ prototype integrated along the camera ray before surface composition. - Temporal debug correction: mode 5 exposes current temporal control. The first look showed the entire Grid red because stale Grid logic marked low support as reactive. Grid reactive is now zero; support/coverage remains the green - signal. + signal. Empty background coverage is now zero; opaque hits write coverage 1 + and Grid hits write support coverage. - Temporal Gate 3L: projection jitter is scaled to zero because Self/planet surfaces visibly juddered. Keep jitter disabled until opaque and Grid resolve both hide the offset. Removed the abandoned unjittered Grid retrace; Grid