Retune grid brightness for temporal resolve

This commit is contained in:
Meta Vens 2026-05-09 23:01:02 +01:00
commit c8a5bd9d9e
3 changed files with 9 additions and 8 deletions

View file

@ -81,7 +81,7 @@ static const float GRID_LINE_PIXEL_FADE = 0.95;
static const float TERRAIN_ISOLINE_PIXEL_WIDTH = 0.54;
static const float TERRAIN_FIELD_LINE_PIXEL_WIDTH = 0.38;
static const float3 GRID_COLOR = float3(0.30, 0.90, 0.82);
static const float GRID_ALPHA_SCALE = 0.24;
static const float GRID_ALPHA_SCALE = 0.56;
VertexOut FullscreenTriangleVS(uint vertexId : SV_VertexID)
{
@ -319,9 +319,9 @@ float3 gridEventColor(float3 p, out float alpha)
float contour = isolineMask(height);
float fieldLine = fieldLineMask(gradient);
float support = saturate(gridAmount * 0.58 + contour * 0.22 + fieldLine * 0.16);
float3 color = GRID_COLOR * gridAmount * 0.90;
color += float3(0.98, 1.0, 0.78) * contour * 0.16;
color += float3(0.36, 0.92, 1.0) * fieldLine * 0.12;
float3 color = GRID_COLOR * gridAmount * 1.05;
color += float3(0.98, 1.0, 0.78) * contour * 0.34;
color += float3(0.36, 0.92, 1.0) * fieldLine * 0.22;
alpha = saturate(support * GRID_ALPHA_SCALE);
return color;
}

View file

@ -52,7 +52,7 @@ static const float GRID_LINE_PIXEL_FADE = 0.95;
static const float TERRAIN_ISOLINE_PIXEL_WIDTH = 0.54;
static const float TERRAIN_FIELD_LINE_PIXEL_WIDTH = 0.38;
static const float3 GRID_COLOR = float3(0.30, 0.90, 0.82);
static const float GRID_ALPHA_SCALE = 0.24;
static const float GRID_ALPHA_SCALE = 0.56;
static const float DITHER_TEXTURE_SIZE = 512.0;
struct VertexOut
@ -378,9 +378,9 @@ float3 gridEventColor(float3 p, out float alpha)
float contour = isolineMask(height);
float fieldLine = fieldLineMask(gradient);
float support = saturate(gridAmount * 0.58 + contour * 0.22 + fieldLine * 0.16);
float3 color = GRID_COLOR * gridAmount * 0.90;
color += float3(0.98, 1.0, 0.78) * contour * 0.16;
color += float3(0.36, 0.92, 1.0) * fieldLine * 0.12;
float3 color = GRID_COLOR * gridAmount * 1.05;
color += float3(0.98, 1.0, 0.78) * contour * 0.34;
color += float3(0.36, 0.92, 1.0) * fieldLine * 0.22;
alpha = saturate(support * GRID_ALPHA_SCALE);
return color;
}

View file

@ -104,3 +104,4 @@
{"timestamp":"2026-05-09T22:43:12.0000000+01:00","topic":"d3d12-grid-blue-noise-dither","lesson":"D3D12 Grid stochastic coverage now uses Aetheria's copied 512x512 R8 blue-noise texture instead of a hash. The texture is uploaded once to a default-heap R8_UNorm resource, exposed through a transient SRV at t15, and sampled point/wrap at s1 in screen space without a frame-wide animated seed so per-pixel coverage stays stable for TAA.","files":["src/Aquarium.Engine/Render/D3D12Renderer.cs","src/Aquarium.Engine/Render/Shaders/D3D12Scene.hlsl","state/memory.json","state/scratch.md"]}
{"timestamp":"2026-05-09T22:55:27.0000000+01:00","topic":"d3d12-grid-temporal-blue-noise","lesson":"Stable blue-noise dithering is too static for TAA to converge stochastic Grid coverage. The failure mode to avoid is global threshold flicker where all pixels toggle together. Use a per-frame low-discrepancy pixel offset into the blue-noise tile so each pixel changes threshold over time while the spatial mask remains decorrelated.","files":["src/Aquarium.Engine/Render/Shaders/D3D12Scene.hlsl","state/memory.json","state/scratch.md"]}
{"timestamp":"2026-05-09T22:59:44.0000000+01:00","topic":"d3d12-grid-taa-color-contract","lesson":"Stable temporal control, history age/weight, and field identity do not prove Grid TAA is smoothing color. D3D12 was still feeding stochastic hit/miss radiance into resolve/history. The fix is the D3D11 contract: post resolve reconstructs analytic Grid color from current Grid travel/world position using the Grid height target, nearest-loads Grid history, and skips color-delta rejection for Grid pixels while raw debug keeps showing the stochastic stream.","files":["src/Aquarium.Engine/Render/D3D12Renderer.cs","src/Aquarium.Engine/Render/Shaders/D3D12Post.hlsl","state/memory.json","state/scratch.md"]}
{"timestamp":"2026-05-09T23:08:12.0000000+01:00","topic":"d3d12-grid-expected-value-brightness","lesson":"Once D3D12 Grid resolve reconstructs the expected stochastic value, line brightness must be tuned as averaged transparent radiance, not as sparse on-sample brightness. The earlier 0.24 alpha scale made Cartesian and isoline contributions collapse when the color path became mathematically honest. Keep scene stochastic selection and post analytic reconstruction using identical Grid color/alpha constants.","files":["src/Aquarium.Engine/Render/Shaders/D3D12Scene.hlsl","src/Aquarium.Engine/Render/Shaders/D3D12Post.hlsl","state/evidence.jsonl"]}