diff --git a/research/rendering/fractal-brush-implementation-roadmap.md b/research/rendering/fractal-brush-implementation-roadmap.md index b1f8314..3a82cea 100644 --- a/research/rendering/fractal-brush-implementation-roadmap.md +++ b/research/rendering/fractal-brush-implementation-roadmap.md @@ -380,7 +380,9 @@ Tasks: compiled brush packets for equivalent selected cuts. - [x] Feed traced planet geometry from a hard-budgeted top-influence subset of selected tile packets. -- [ ] Add face/tile/LOD/cache debug modes. +- [x] Add first face/tile/material influence debug view through render debug + mode 11. +- [ ] Add LOD/cache debug overlays. - [ ] Remove or quarantine old spherical noise path as baseline fixture. Tests: diff --git a/src/Aquarium.Engine.Contracts/GraphicsSettings.cs b/src/Aquarium.Engine.Contracts/GraphicsSettings.cs index f70d79a..e5796f0 100644 --- a/src/Aquarium.Engine.Contracts/GraphicsSettings.cs +++ b/src/Aquarium.Engine.Contracts/GraphicsSettings.cs @@ -7,7 +7,7 @@ public readonly record struct GraphicsSettings( float BloomVeilIntensity) { public const int MinRenderDebugMode = 0; - public const int MaxRenderDebugMode = 10; + public const int MaxRenderDebugMode = 11; public const float MinSceneExposure = 0.02f; public const float MaxSceneExposure = 1.2f; public const float MinBloomIntensity = 0.0f; diff --git a/src/Aquarium.Engine/Render/D3D12Renderer.cs b/src/Aquarium.Engine/Render/D3D12Renderer.cs index 0ce3083..b027a96 100644 --- a/src/Aquarium.Engine/Render/D3D12Renderer.cs +++ b/src/Aquarium.Engine/Render/D3D12Renderer.cs @@ -76,6 +76,7 @@ public sealed class D3D12Renderer : IAquariumRenderer new(8, "Exposed Luminance"), new(9, "SdfObject Identity"), new(10, "SdfObject Steps"), + new(11, "Client Fractal Domains"), ]; private static readonly DebugUi.DebugUiOption[] SynthPresetOptions = AquaSynth.Dsl.BuiltInScripts.ReferenceScripts() .Select((preset, index) => new DebugUi.DebugUiOption(index, $"{preset.Family}/{preset.Name}")) diff --git a/src/Aquarium.Zyphos/Shaders/D3D12ZyphosPlanet.hlsl b/src/Aquarium.Zyphos/Shaders/D3D12ZyphosPlanet.hlsl index 10faadf..47eca4e 100644 --- a/src/Aquarium.Zyphos/Shaders/D3D12ZyphosPlanet.hlsl +++ b/src/Aquarium.Zyphos/Shaders/D3D12ZyphosPlanet.hlsl @@ -151,6 +151,30 @@ float zyAuthoredBrushTerrain(float3 dir, out float materialMask) return zyAuthoredBrushTerrainLimited(dir, 64, materialMask); } +float3 zyFaceDebugColor(float face) +{ + if (face < 0.5) return float3(0.95, 0.18, 0.14); + if (face < 1.5) return float3(0.12, 0.56, 1.00); + if (face < 2.5) return float3(0.20, 0.88, 0.34); + if (face < 3.5) return float3(1.00, 0.78, 0.18); + if (face < 4.5) return float3(0.78, 0.36, 1.00); + return float3(0.10, 0.90, 0.86); +} + +float3 zyFractalDomainDebug(float3 dir) +{ + float face; + float2 faceUv = zyCubeFaceUv(dir, face); + float materialMask; + float authoredHeight = zyAuthoredBrushTerrain(dir, materialMask); + float2 grid = abs(frac((faceUv * 0.5 + 0.5) * 8.0) - 0.5); + float line = 1.0 - smoothstep(0.015, 0.055, min(grid.x, grid.y)); + float3 faceColor = zyFaceDebugColor(face); + float signedHeight = authoredHeight >= 0.0 ? 1.0 : 0.0; + float3 brushColor = lerp(float3(0.12, 0.28, 1.0), float3(1.0, 0.42, 0.12), signedHeight) * saturate(materialMask * 5.0); + return saturate(faceColor * 0.28 + line.xxx * 0.34 + brushColor); +} + float zyTileRelief(float2 uv, float level, float amplitude, float ridgeBias) { float scale = exp2(level); @@ -264,6 +288,11 @@ float3 shadeSdf(float2 uv, float travel, float3 p, float3 normal, int sdfIndex, { SdfObject sdfObject = sdfObjects[sdfIndex]; float3 dir = zyPlanetDir(p - sdfObject.centerRadius.xyz, sdfObject); + if (renderDebugMode >= 10.5 && renderDebugMode < 11.5) + { + return zyFractalDomainDebug(dir); + } + float3 viewDirection = normalize(cameraPosition - p); float3 starDirectionLocal = zyPrimaryStarDirectionLocal(sdfObject); float eclipse = zyUmbrosEclipse(starDirectionLocal); diff --git a/state/evidence.jsonl b/state/evidence.jsonl index dff7d2a..a84e5ea 100644 --- a/state/evidence.jsonl +++ b/state/evidence.jsonl @@ -157,3 +157,4 @@ {"timestamp":"2026-05-19T15:29:00+01:00","topic":"temporal-evidence-lowering-boundary","lesson":"Shared temporal evidence now has named lowering helpers. `TemporalSpatialEvidenceLowering` converts Gaussian observations and GPU fusion seeds to/from reservoir samples, so consumer adapters do not privately pack Payload0/Payload1 conventions. Keep new reservoir consumers on this lowering seam unless they need a genuinely new payload contract.","files":["src/Aquarium.Engine.Fractal/Temporal/TemporalSpatialEvidenceLowering.cs","src/Aquarium.Engine.Fractal/Temporal/TemporalGaussianAccumulator.cs","src/Aquarium.LocalCast/LocalCastGpuFusionAccumulator.cs","tests/Aquarium.Engine.Fractal.Tests/TemporalSpatialEvidenceLoweringTests.cs"],"source":"follow-up after moving LocalCast history onto the shared reservoir; adapter payload packing needed to become a tested engine boundary"} {"timestamp":"2026-05-19T15:46:00+01:00","topic":"temporal-reservoir-ownership-contract","lesson":"The temporal spatial evidence reservoir now has an explicit architecture contract. Raw sample reservoirs keep capture-time handles and ordering; Aquarium's `TemporalSpatialEvidenceReservoir` owns stable resolved spatial history; `TemporalSpatialEvidenceLowering` owns backend packet conversion; TAA owns pixel history. This prevents consumer repos from growing parallel half-reservoirs while preserving LocalCastBridge's lower-level raw rolling reservoir authority.","files":["docs/temporal-spatial-evidence-reservoir.md","state/map.yaml","state/memory.json"],"source":"user made Aquarium responsible for resolving temporal reservoir sampling architecturally across consumer repos"} {"timestamp":"2026-05-19T16:11:00+01:00","topic":"zyphos-budgeted-fractal-geometry","lesson":"Authored fractal packets now affect Zyphos traced planet geometry, but only through a hard-budgeted top-influence subset. Selected height brushes are sorted by abs(amplitude)*max(radius), `sdfDistance` samples the first four, and `sdfSurface` still evaluates the full selected packet table for material/detail. A 12-brush geometry loop was tested and cut after pushing the live frame to about 33 ms; the four-brush budget returns the live view to about 16.4 ms after shader pipelines are ready.","files":["src/Aquarium.Zyphos/ZyphosFractalTerrain.cs","src/Aquarium.Zyphos/Shaders/D3D12ZyphosPlanet.hlsl","tests/Aquarium.Engine.Fractal.Tests/ZyphosFractalTerrainTests.cs"],"source":"runtime proof after moving authored fractal packet evaluation into the hot SDF distance path"} +{"timestamp":"2026-05-19T16:27:00+01:00","topic":"zyphos-fractal-domain-debug-mode","lesson":"Render debug mode 11 now exposes a client fractal-domain view. Zyphos colors cube faces, draws an 8x8 tile grid, and overlays authored brush material influence so face/tile/material packet mapping can be inspected from the renderer instead of inferred from final beauty shading.","files":["src/Aquarium.Engine.Contracts/GraphicsSettings.cs","src/Aquarium.Engine/Render/D3D12Renderer.cs","src/Aquarium.Zyphos/Shaders/D3D12ZyphosPlanet.hlsl","research/rendering/fractal-brush-implementation-roadmap.md"],"source":"roadmap called for face/tile/LOD/cache debug modes; this is the first renderer-visible face/tile/material influence slice"}