diff --git a/src/Aquarium.Engine.Contracts/Render/AquariumRenderPlan.cs b/src/Aquarium.Engine.Contracts/Render/AquariumRenderPlan.cs index b16bb3f..9fd6fbd 100644 --- a/src/Aquarium.Engine.Contracts/Render/AquariumRenderPlan.cs +++ b/src/Aquarium.Engine.Contracts/Render/AquariumRenderPlan.cs @@ -230,18 +230,9 @@ public sealed class AquariumSceneState { public static AquariumSceneState Empty { get; } = new(); - public AquariumSceneVisualOptions VisualOptions { get; init; } = AquariumSceneVisualOptions.Default; - public IReadOnlyList HeightFieldBrushes { get; init; } = []; public IReadOnlyList SdfObjects { get; init; } = []; public IReadOnlyList SdfLights { get; init; } = []; } - -public readonly record struct AquariumSceneVisualOptions( - float BackgroundIntensity, - float SurfaceVisibility) -{ - public static AquariumSceneVisualOptions Default { get; } = new(1.0f, 1.0f); -} diff --git a/src/Aquarium.Engine/Render/D3D12Renderer.cs b/src/Aquarium.Engine/Render/D3D12Renderer.cs index 0b34576..a1d9e6a 100644 --- a/src/Aquarium.Engine/Render/D3D12Renderer.cs +++ b/src/Aquarium.Engine/Render/D3D12Renderer.cs @@ -140,7 +140,6 @@ public sealed class D3D12Renderer : IAquariumRenderer private float previousViewRadius = 0.001f; private float previousTimeSeconds; private D3D12HeightFieldBrushConstants heightFieldBrushConstants; - private Vector4 sceneVisualControls = Vector4.One; private GraphicsSettings settings = GraphicsSettings.Default; private double accumulatedFrameCpuMilliseconds; private double accumulatedRecordCpuMilliseconds; @@ -485,8 +484,7 @@ public sealed class D3D12Renderer : IAquariumRenderer settings.SceneExposure, settings.BloomIntensity, settings.BloomVeilIntensity, - new Vector4(frame.CursorWorld.X, frame.CursorWorld.Y, previousCursorWorld.X, previousCursorWorld.Y), - sceneVisualControls)); + new Vector4(frame.CursorWorld.X, frame.CursorWorld.Y, previousCursorWorld.X, previousCursorWorld.Y))); frameResources.FrameConstantsDescriptor = frameResources.TransientShaderDescriptors.Allocate(); device.CreateConstantBufferView( new ConstantBufferViewDescription(frameConstants.GpuVirtualAddress, frameConstants.SizeInBytes), @@ -1386,11 +1384,6 @@ public sealed class D3D12Renderer : IAquariumRenderer Array.Clear(sdfObjects); Array.Clear(sdfLights); heightFieldBrushConstants = D3D12HeightFieldBrushConstants.FromBrushes(scene.HeightFieldBrushes); - sceneVisualControls = new Vector4( - Math.Clamp(scene.VisualOptions.BackgroundIntensity, 0.0f, 4.0f), - Math.Clamp(scene.VisualOptions.SurfaceVisibility, 0.0f, 1.0f), - 0.0f, - 0.0f); var objectCount = Math.Min(scene.SdfObjects.Count, MaxSdfObjectCount); for (var index = 0; index < objectCount; index++) @@ -2032,8 +2025,7 @@ public sealed class D3D12Renderer : IAquariumRenderer float Exposure, float BloomIntensity, float BloomVeilIntensity, - Vector4 CursorWorlds, - Vector4 SceneVisualControls); + Vector4 CursorWorlds); private sealed record D3D12ShaderPaths( string HeightField, diff --git a/src/Aquarium.Engine/Render/Shaders/D3D12HeightField.hlsl b/src/Aquarium.Engine/Render/Shaders/D3D12HeightField.hlsl index 13bade8..12e0232 100644 --- a/src/Aquarium.Engine/Render/Shaders/D3D12HeightField.hlsl +++ b/src/Aquarium.Engine/Render/Shaders/D3D12HeightField.hlsl @@ -18,7 +18,6 @@ cbuffer AquariumFrame : register(b0) float bloomIntensity; float bloomVeilIntensity; float4 cursorWorlds; - float4 sceneVisualControls; }; cbuffer HeightFieldBrushes : register(b1) diff --git a/src/Aquarium.Engine/Render/Shaders/D3D12Post.hlsl b/src/Aquarium.Engine/Render/Shaders/D3D12Post.hlsl index 8235669..0f56bea 100644 --- a/src/Aquarium.Engine/Render/Shaders/D3D12Post.hlsl +++ b/src/Aquarium.Engine/Render/Shaders/D3D12Post.hlsl @@ -18,7 +18,6 @@ cbuffer AquariumFrame : register(b0) float bloomIntensity; float bloomVeilIntensity; float4 cursorWorlds; - float4 sceneVisualControls; }; Texture2D sourceTexture : register(t0); diff --git a/src/Aquarium.Engine/Render/Shaders/D3D12Scene.hlsl b/src/Aquarium.Engine/Render/Shaders/D3D12Scene.hlsl index ce0c24e..5fdf484 100644 --- a/src/Aquarium.Engine/Render/Shaders/D3D12Scene.hlsl +++ b/src/Aquarium.Engine/Render/Shaders/D3D12Scene.hlsl @@ -18,7 +18,6 @@ cbuffer AquariumFrame : register(b0) float bloomIntensity; float bloomVeilIntensity; float4 cursorWorlds; - float4 sceneVisualControls; }; Texture2D heightFieldTexture : register(t0); @@ -210,7 +209,7 @@ float3 backgroundRadiance(float3 direction) RayMarchResult traverseRay(float3 origin, float3 direction) { RayMarchResult result; - result.color = backgroundRadiance(direction) * sceneVisualControls.x; + result.color = backgroundRadiance(direction); result.travel = farDistance + 1.0; result.fieldId = 0.0; result.normal = 0.0; @@ -219,7 +218,7 @@ RayMarchResult traverseRay(float3 origin, float3 direction) float3 surfacePosition; float surfaceTravel; - bool surfaceHit = sceneVisualControls.y > 0.5 && traceHeightFieldSurfaceDirect(origin, direction, 0.0, farDistance, surfacePosition, surfaceTravel); + bool surfaceHit = traceHeightFieldSurfaceDirect(origin, direction, 0.0, farDistance, surfacePosition, surfaceTravel); if (surfaceHit) { float3 surfaceNormal; diff --git a/src/Aquarium.Engine/Render/Shaders/D3D12SdfCommon.hlsli b/src/Aquarium.Engine/Render/Shaders/D3D12SdfCommon.hlsli index c02c6ba..d5b7286 100644 --- a/src/Aquarium.Engine/Render/Shaders/D3D12SdfCommon.hlsli +++ b/src/Aquarium.Engine/Render/Shaders/D3D12SdfCommon.hlsli @@ -18,7 +18,6 @@ cbuffer AquariumFrame : register(b0) float bloomIntensity; float bloomVeilIntensity; float4 cursorWorlds; - float4 sceneVisualControls; }; TextureCube studioPmremTexture : register(t22); diff --git a/src/Aquarium.Epiphany.AgentPreview/Aquarium.Epiphany.AgentPreview.csproj b/src/Aquarium.Epiphany.AgentPreview/Aquarium.Epiphany.AgentPreview.csproj index ff708f0..341270e 100644 --- a/src/Aquarium.Epiphany.AgentPreview/Aquarium.Epiphany.AgentPreview.csproj +++ b/src/Aquarium.Epiphany.AgentPreview/Aquarium.Epiphany.AgentPreview.csproj @@ -12,4 +12,8 @@ + + + + diff --git a/src/Aquarium.Epiphany.AgentPreview/Program.cs b/src/Aquarium.Epiphany.AgentPreview/Program.cs index 7f03651..54a0bd8 100644 --- a/src/Aquarium.Epiphany.AgentPreview/Program.cs +++ b/src/Aquarium.Epiphany.AgentPreview/Program.cs @@ -29,7 +29,7 @@ using var renderer = new D3D12Renderer( options.Width, options.Height, shaderPath, - EpiphanyRenderPlan.Create(), + CreatePreviewRenderPlan(), new GraphicsSettings(0, options.Exposure, options.BloomIntensity, options.BloomVeilIntensity)); renderer.DebugUiVisible = false; @@ -97,13 +97,19 @@ static AquariumFrame CreateFrame(PreviewSubject subject, PreviewView view, float }; var scene = new AquariumSceneState { - VisualOptions = new AquariumSceneVisualOptions(0.0f, 0.0f), SdfObjects = objects, SdfLights = lights, }; return new AquariumFrame(new ViewFrame(Vector2.Zero, 20.0f), view.CameraPosition, timeSeconds, Vector2.Zero, scene); } +static AquariumRenderPlan CreatePreviewRenderPlan() +{ + var plan = EpiphanyRenderPlan.Create(); + plan.Shaders.Scene("D3D12AgentPreviewScene.hlsl"); + return plan; +} + static AquariumSdfObject InactiveObject(int index) { var center = new Vector3(10000.0f + index * 13.0f, 10000.0f, 10000.0f); @@ -132,7 +138,7 @@ sealed record PreviewOptions( IntValueAfter(args, "--width", 768), IntValueAfter(args, "--height", 768), IntValueAfter(args, "--frames", 18), - IntValueAfter(args, "--warmup-limit", 900), + IntValueAfter(args, "--warmup-limit", 3600), FloatValueAfter(args, "--time", 18.0f), FloatValueAfter(args, "--exposure", 0.24f), FloatValueAfter(args, "--bloom", 0.12f), diff --git a/src/Aquarium.Epiphany.AgentPreview/Shaders/D3D12AgentPreviewScene.hlsl b/src/Aquarium.Epiphany.AgentPreview/Shaders/D3D12AgentPreviewScene.hlsl new file mode 100644 index 0000000..a1d60be --- /dev/null +++ b/src/Aquarium.Epiphany.AgentPreview/Shaders/D3D12AgentPreviewScene.hlsl @@ -0,0 +1,54 @@ +cbuffer AquariumFrame : register(b0) +{ + float2 resolution; + float timeSeconds; + float viewRadius; + float3 cameraPosition; + float farDistance; + float2 viewCenter; + float frameIndex; + float previousTimeSeconds; + float3 previousCameraPosition; + float previousViewRadius; + float2 previousViewCenter; + float2 jitterPixels; + float2 previousJitterPixels; + float renderDebugMode; + float exposure; + float bloomIntensity; + float bloomVeilIntensity; + float4 cursorWorlds; +}; + +struct VertexOut +{ + float4 position : SV_Position; + float2 uv : TEXCOORD0; +}; + +struct SceneOut +{ + float4 colorTravel : SV_Target0; + float4 metadata : SV_Target1; + float4 control : SV_Target2; + float depth : SV_Depth; +}; + +VertexOut FullscreenTriangleVS(uint vertexId : SV_VertexID) +{ + float2 uv = float2((vertexId << 1) & 2, vertexId & 2); + VertexOut output; + output.position = float4(uv * float2(2.0, -2.0) + float2(-1.0, 1.0), 0.0, 1.0); + output.uv = uv; + return output; +} + +SceneOut D3D12ScenePS(VertexOut input) +{ + SceneOut output; + output.colorTravel = float4(0.0, 0.0, 0.0, farDistance + 1.0); + output.metadata = 0.0; + output.control = 0.0; + output.depth = 1.0; + return output; +} diff --git a/state/evidence.jsonl b/state/evidence.jsonl index 8f4bf2e..142815f 100644 --- a/state/evidence.jsonl +++ b/state/evidence.jsonl @@ -93,4 +93,4 @@ {"timestamp":"2026-05-13T19:45:00+01:00","topic":"soul-facet-normal-authority","lesson":"Soul must shade like cut crystal, not thermoformed plastic. If relief participates in ray distance, do not let the finite-difference relief normal dominate broad facets; shade from the governing facet normal and blend the traced normal only near cuts. Transmission should support dark glass depth and inner oath light, not wash every face into milky white.","files":["src/Aquarium.Epiphany/Shaders/D3D12SoulAgent.hlsl","state/evidence.jsonl"],"source":"user screenshot showed Soul still reading as vacuum-formed packaging after domain reset"} {"timestamp":"2026-05-13T20:00:00+01:00","topic":"soul-plane-intersection-crystal","lesson":"Soul seams are not unreasonable as geometry: build the crystal from explicit signed half-space planes, derive edges from adjacent active plane intersections, then extrude face interiors and cut narrow V-grooves on selected edge chains. Auxiliary gates may choose which edges glow, but the edge itself must come from the plane intersection graph. Broad shading uses the active plane normal; cut normals are secondary.","files":["src/Aquarium.Epiphany/Shaders/D3D12SoulAgent.hlsl","state/evidence.jsonl"],"source":"user asked for organic plane intersections with extruded faces and glowing groove centers"} {"timestamp":"2026-05-13T20:18:00+01:00","topic":"soul-organic-plane-family","lesson":"Soul's plane-intersection crystal should not default back to symmetric octahedral sign pairs. Keep the half-space/active-edge architecture, but use an irregular family of constraint planes with varied offsets plus a few smaller trimming planes so the crystal reads as a living verdict object instead of an octahedron with minor perturbations.","files":["src/Aquarium.Epiphany/Shaders/D3D12SoulAgent.hlsl","state/evidence.jsonl"],"source":"user noted the plane-intersection model was right but the cutting planes still looked too octahedral"} -{"timestamp":"2026-05-13T20:56:00+01:00","topic":"isolated-agent-preview-loop","lesson":"Agent SDF iteration needs a renderer-owned visual feedback loop. Use the real D3D12 renderer to render one selected Epiphany SDF subject across several isolated camera views with background and surface disabled, then save final-frame PNGs for reference-art comparison; do not duplicate shader logic in a separate toy renderer.","files":["src/Aquarium.Epiphany.AgentPreview/Program.cs","scripts/render-agent-preview.ps1","src/Aquarium.Engine/Render/D3D12Renderer.cs","src/Aquarium.Engine.Contracts/Render/AquariumRenderPlan.cs","state/map.yaml","state/evidence.jsonl"],"source":"user requested self-directed visual iteration instead of screenshot babysitting"} +{"timestamp":"2026-05-13T20:56:00+01:00","topic":"isolated-agent-preview-loop","lesson":"Agent SDF iteration needs a renderer-owned visual feedback loop. Use the real D3D12 renderer to render one selected Epiphany SDF subject across several isolated camera views, then save final-frame PNGs for reference-art comparison. Preview-only isolation belongs in the preview render plan/shader, not in regular scene frame controls; do not duplicate SDF shader logic in a separate toy renderer.","files":["src/Aquarium.Epiphany.AgentPreview/Program.cs","src/Aquarium.Epiphany.AgentPreview/Shaders/D3D12AgentPreviewScene.hlsl","scripts/render-agent-preview.ps1","src/Aquarium.Engine/Render/D3D12Renderer.cs","state/map.yaml","state/evidence.jsonl"],"source":"user requested self-directed visual iteration, then caught preview isolation leaking into the normal client"} diff --git a/state/map.yaml b/state/map.yaml index cd14c82..a2922d4 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -85,7 +85,7 @@ renderer_state: - Aquarium exposes an optional synth/audio hosting boundary through AquariumSynthDocument; Aquarium consumes AquariumSynth.Dsl as a pinned repo-local NuGet package so synth-agent construction cannot break Aquarium builds until the package is intentionally updated. - Global GraphicsSettings document feeding render debug, exposure, bloom intensity, and bloom veil. - Temporal resolve uses scene color, metadata, and control history only; dormant event history lanes are cut until a real producer and consumer contract exists. - - Isolated Epiphany agent preview renders run through the real D3D12 renderer from src/Aquarium.Epiphany.AgentPreview; the engine exposes only generic scene visual controls and final-frame PNG capture. + - Isolated Epiphany agent preview renders run through the real D3D12 renderer from src/Aquarium.Epiphany.AgentPreview; preview isolation is owned by a preview-only scene shader, while the engine exposes only final-frame PNG capture. - Bundled blue-noise texture assets are retained for future dithering/noise work even though the removed medium path no longer samples them. - D3D11 scene renderer, runtime volumetrics, cloud/fog research, medium/froxel render targets, and the SDF-field renderer plan are shelved and removed from live repo state. next: