Retain stochastic event history harder

This commit is contained in:
Meta Vens 2026-05-10 04:51:19 +01:00
commit 65367f2de1
5 changed files with 9 additions and 3 deletions

View file

@ -41,7 +41,7 @@ public sealed class D3D11Renderer : IAquariumRenderer
new(3, "History Age"),
new(4, "History Weight"),
new(5, "Temporal Control"),
new(6, "Field Identity"),
new(6, "Lane Identity"),
new(7, "Bloom"),
new(8, "Exposed Luminance"),
new(9, "Medium Ray Density"),

View file

@ -53,7 +53,7 @@ public sealed class D3D12Renderer : IAquariumRenderer
new(3, "History Age"),
new(4, "History Weight"),
new(5, "Temporal Control"),
new(6, "Field Identity"),
new(6, "Lane Identity"),
new(7, "Bloom"),
new(8, "Exposed Luminance"),
new(9, "Medium Ray Density"),

View file

@ -623,7 +623,7 @@ ResolveOut D3D12ResolvePS(VertexOut input)
float coverageContinuityWeight = 1.0 - smoothstep(0.12, 0.65, abs(previousEventCoverage - currentEventCoverage));
float eventConfidence = smoothstep(0.0, 8.0, previousEventAge);
float validationWeight = travelWeight * fieldWeight * coverageContinuityWeight * smoothstep(0.001, 0.08, currentEventCoverage);
eventHistoryWeight = 0.92 * lerp(0.58, 1.0, eventConfidence) * validationWeight;
eventHistoryWeight = 0.985 * lerp(0.72, 1.0, eventConfidence) * validationWeight;
eventHistoryAge = validationWeight > 0.01 ? min(previousEventAge + 1.0, MAX_HISTORY_AGE) : 0.0;
eventHistoryColor = loadHistoryEventColor(previousEventUv).rgb;
}

View file

@ -110,3 +110,4 @@
{"timestamp":"2026-05-09T23:29:52.0000000+01:00","topic":"d3d12-grid-volumetric-ordering","lesson":"A transparent Grid overlay must not become the visible scene packet. D3D12 was writing FIELD_ID_GRID, Grid travel, normal, coverage, and medium-to-Grid opacity even when fog/solid content behind it was the real scene. That made temporal debug views and volumetric history classify or clip fog by the Grid. The Grid is now a non-terminating stochastic color overlay added after solid/medium composition, while field identity/travel/control stay owned by the actual opaque or medium result. Future Grid stabilization needs a separate transparent-overlay temporal lane, not reuse of the scene packet.","files":["src/Aquarium.Engine/Render/Shaders/D3D12Scene.hlsl","src/Aquarium.Engine/Render/Shaders/D3D12Post.hlsl","src/Aquarium.Engine/Render/D3D12Renderer.cs","state/memory.json","state/scratch.md"]}
{"timestamp":"2026-05-09T23:45:11.0000000+01:00","topic":"d3d12-medium-temporal-lane","lesson":"Surface identity and medium identity cannot share one temporal metadata packet. A medium in front of a planet should have its own opacity, centroid travel, density, history age, and history weight even though the planet remains the hard ray terminator. D3D12 now emits a separate medium packet MRT and ping-pongs medium history beside surface history. Debug field identity can show medium where opacity exists; Grid/particles should follow with a separate stochastic-event packet rather than stealing surface or medium identity.","files":["src/Aquarium.Engine/Render/D3D12Renderer.cs","src/Aquarium.Engine/Render/Shaders/D3D12Scene.hlsl","src/Aquarium.Engine/Render/Shaders/D3D12Post.hlsl","state/memory.json","state/scratch.md"]}
{"timestamp":"2026-05-09T23:56:00.0000000+01:00","topic":"d3d12-stochastic-event-lane","lesson":"Stochastic transparent surfaces need their own temporal lane. The Grid now emits event color plus event metadata, and resolve accumulates that event history before compositing it over the surface+medium scene. Particles and billboard surfaces should join this sampled-event path rather than alpha blending or stealing surface identity.","files":["src/Aquarium.Engine/Render/D3D12Renderer.cs","src/Aquarium.Engine/Render/Shaders/D3D12Scene.hlsl","src/Aquarium.Engine/Render/Shaders/D3D12Post.hlsl","state/memory.json","state/scratch.md"]}
{"timestamp":"2026-05-10T04:52:00.0000000+01:00","topic":"d3d12-stochastic-event-retention","lesson":"A stochastic event temporal lane must retain history much more aggressively than opaque surface TAA. With a 0.92 event history cap, dither misses visibly erode low-coverage Grid lines and leave grain. Use very high validated retention for event radiance and label composite event/medium/surface debug views as lane identity rather than field identity.","files":["src/Aquarium.Engine/Render/Shaders/D3D12Post.hlsl","src/Aquarium.Engine/Render/D3D12Renderer.cs","src/Aquarium.Engine/Render/D3D11Renderer.cs","state/scratch.md"]}

View file

@ -52,6 +52,11 @@ reusing field identity/travel/control.
resolved surface+medium scene. This is the future particle/billboard class:
sampled event color plus event metadata, not alpha blending and not the solid
surface packet.
- Event TAA tuning: stochastic event history needs very high retention. A 0.92
cap still lets every dither miss chew visible chunks out of low-coverage Grid
lines, leaving grain. Current D3D12 event lane uses 0.985 max retention with a
stronger fresh-history floor. Debug mode 6 is named Lane Identity because it
shows the winning diagnostic lane, not only the hard surface field id.
## Hot Context