Render computed fractal splats
This commit is contained in:
parent
11e8526506
commit
0d289108f8
7 changed files with 197 additions and 5 deletions
|
|
@ -150,6 +150,12 @@ public sealed class AquariumShaderBuilder(AquariumShaderManifest manifest)
|
|||
return this;
|
||||
}
|
||||
|
||||
public AquariumShaderBuilder FractalSplatRender(string path)
|
||||
{
|
||||
manifest.FractalSplatRender(path);
|
||||
return this;
|
||||
}
|
||||
|
||||
public AquariumShaderBuilder Include(string path)
|
||||
{
|
||||
manifest.Include(path);
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@ public sealed class AquariumShaderManifest
|
|||
|
||||
public string FractalReservoirShader { get; private set; } = "D3D12FractalReservoirCompute.hlsl";
|
||||
|
||||
public string FractalSplatRenderShader { get; private set; } = "D3D12FractalSplatRender.hlsl";
|
||||
|
||||
public string PostShader { get; private set; } = "D3D12Post.hlsl";
|
||||
|
||||
public string SdfCommonInclude { get; private set; } = "D3D12SdfCommon.hlsli";
|
||||
|
|
@ -83,6 +85,12 @@ public sealed class AquariumShaderManifest
|
|||
return this;
|
||||
}
|
||||
|
||||
public AquariumShaderManifest FractalSplatRender(string path)
|
||||
{
|
||||
FractalSplatRenderShader = path;
|
||||
return this;
|
||||
}
|
||||
|
||||
public AquariumShaderManifest Post(string path)
|
||||
{
|
||||
PostShader = path;
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ public sealed class D3D12Renderer : IAquariumRenderer
|
|||
private const int MaxAcousticConstraintCount = 128;
|
||||
private const int GpuSensorSamplesPerTexture = 131_072;
|
||||
private const int MaxTemporalGaussianCount = 1_048_576;
|
||||
private const int MaxVisibleFractalSplatCount = 131_072;
|
||||
private const float SurfaceTransparentMinZ = -1.85f;
|
||||
private const float SurfaceTransparentMaxZ = 0.45f;
|
||||
private const int BloomLevelCount = 3;
|
||||
|
|
@ -113,6 +114,7 @@ public sealed class D3D12Renderer : IAquariumRenderer
|
|||
private ID3D12PipelineState? scenePipelineState;
|
||||
private ID3D12PipelineState? temporalGaussianPipelineState;
|
||||
private ID3D12PipelineState? localCastFusionPipelineState;
|
||||
private ID3D12PipelineState? fractalSplatRenderPipelineState;
|
||||
private ID3D12PipelineState? fractalSplatPipelineState;
|
||||
private ID3D12PipelineState? fractalSdfReservoirPipelineState;
|
||||
private ID3D12PipelineState? fractalPbrReservoirPipelineState;
|
||||
|
|
@ -181,6 +183,7 @@ public sealed class D3D12Renderer : IAquariumRenderer
|
|||
private int acousticConstraintCount;
|
||||
private int gpuFusionSeedCount;
|
||||
private int gpuFusionPointCount;
|
||||
private int visibleFractalSplatCount;
|
||||
private bool temporalGaussiansGpuGenerated;
|
||||
private AquariumFractalReservoirField activeFractalReservoirField = AquariumFractalReservoirField.Empty;
|
||||
private Viewport viewport;
|
||||
|
|
@ -593,7 +596,12 @@ public sealed class D3D12Renderer : IAquariumRenderer
|
|||
acousticConstraintCount,
|
||||
gpuFusionPointCount,
|
||||
activePresentationDelay,
|
||||
frame.Scene.AcousticFieldFrame.HasInput ? 1.0f : 0.0f)));
|
||||
frame.Scene.AcousticFieldFrame.HasInput ? 1.0f : 0.0f),
|
||||
new Vector4(
|
||||
activeFractalReservoirField.HasInput ? activeFractalReservoirField.SplatCount : 0,
|
||||
visibleFractalSplatCount,
|
||||
activeFractalReservoirField.HasInput ? activeFractalReservoirField.ReservoirUpdatesPerPass : 0,
|
||||
activeFractalReservoirField.HasInput ? activeFractalReservoirField.CandidatesPerReservoirUpdate : 0)));
|
||||
frameResources.FrameConstantsDescriptor = frameResources.TransientShaderDescriptors.Allocate();
|
||||
device.CreateConstantBufferView(
|
||||
new ConstantBufferViewDescription(frameConstants.GpuVirtualAddress, frameConstants.SizeInBytes),
|
||||
|
|
@ -622,6 +630,12 @@ public sealed class D3D12Renderer : IAquariumRenderer
|
|||
temporalGaussianBuffer.CreateShaderResourceView(device, frameResources.TemporalGaussianDescriptor);
|
||||
frameResources.TemporalGaussianUnorderedAccessDescriptor = frameResources.TransientShaderDescriptors.Allocate();
|
||||
temporalGaussianBuffer.CreateUnorderedAccessView(device, frameResources.TemporalGaussianUnorderedAccessDescriptor);
|
||||
if (fractalSplatBuffer is not null)
|
||||
{
|
||||
frameResources.FractalSplatDescriptor = frameResources.TransientShaderDescriptors.Allocate();
|
||||
fractalSplatBuffer.CreateShaderResourceView(device, frameResources.FractalSplatDescriptor);
|
||||
}
|
||||
|
||||
frameResources.StudioPmremDescriptor = frameResources.TransientShaderDescriptors.Allocate();
|
||||
studioPmremTexture.CreateShaderResourceView(device, frameResources.StudioPmremDescriptor);
|
||||
frameResources.StudioIrradianceDescriptor = frameResources.TransientShaderDescriptors.Allocate();
|
||||
|
|
@ -799,6 +813,7 @@ public sealed class D3D12Renderer : IAquariumRenderer
|
|||
&& scenePipelineState is not null
|
||||
&& temporalGaussianPipelineState is not null
|
||||
&& localCastFusionPipelineState is not null
|
||||
&& fractalSplatRenderPipelineState is not null
|
||||
&& fractalSplatPipelineState is not null
|
||||
&& fractalSdfReservoirPipelineState is not null
|
||||
&& fractalPbrReservoirPipelineState is not null
|
||||
|
|
@ -998,6 +1013,8 @@ public sealed class D3D12Renderer : IAquariumRenderer
|
|||
temporalGaussian.Name = "Aquarium D3D12 Temporal Gaussian Pipeline";
|
||||
var localCastFusion = CreateLocalCastFusionPipelineState(paths.LocalCastFusion);
|
||||
localCastFusion.Name = "Aquarium D3D12 LocalCast Fusion Compute Pipeline";
|
||||
var fractalSplatRender = CreateFractalSplatRenderPipelineState(paths.FractalSplatRender);
|
||||
fractalSplatRender.Name = "Aquarium D3D12 Fractal Splat Render Pipeline";
|
||||
var fractalSplat = CreateFractalReservoirPipelineState(paths.FractalReservoir, "D3D12FractalSplatReceiptCS");
|
||||
fractalSplat.Name = "Aquarium D3D12 Fractal Splat Compute Pipeline";
|
||||
var fractalSdfReservoir = CreateFractalReservoirPipelineState(paths.FractalReservoir, "D3D12SdfEnvelopeReservoirCS");
|
||||
|
|
@ -1030,6 +1047,7 @@ public sealed class D3D12Renderer : IAquariumRenderer
|
|||
scene,
|
||||
temporalGaussian,
|
||||
localCastFusion,
|
||||
fractalSplatRender,
|
||||
fractalSplat,
|
||||
fractalSdfReservoir,
|
||||
fractalPbrReservoir,
|
||||
|
|
@ -1453,6 +1471,14 @@ public sealed class D3D12Renderer : IAquariumRenderer
|
|||
context.CommandList.SetPipelineState(temporalGaussianPipelineState!);
|
||||
context.CommandList.DrawInstanced(6, (uint)temporalGaussianCount, 0, 0);
|
||||
}
|
||||
|
||||
if (visibleFractalSplatCount > 0 && fractalSplatBuffer is not null)
|
||||
{
|
||||
fractalSplatBuffer.Transition(context.CommandList, ResourceStates.PixelShaderResource | ResourceStates.NonPixelShaderResource);
|
||||
context.CommandList.SetGraphicsRootDescriptorTable(RootTemporalGaussians, frameResources.FractalSplatDescriptor.Gpu);
|
||||
context.CommandList.SetPipelineState(fractalSplatRenderPipelineState!);
|
||||
context.CommandList.DrawInstanced(6, (uint)visibleFractalSplatCount, 0, 0);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
|
@ -1814,6 +1840,9 @@ public sealed class D3D12Renderer : IAquariumRenderer
|
|||
activeFractalReservoirField = scene.FractalReservoirField.HasInput
|
||||
? scene.FractalReservoirField
|
||||
: AquariumFractalReservoirField.Empty;
|
||||
visibleFractalSplatCount = activeFractalReservoirField.HasInput
|
||||
? Math.Min(activeFractalReservoirField.SplatCount, MaxVisibleFractalSplatCount)
|
||||
: 0;
|
||||
heightFieldBrushConstants = D3D12HeightFieldBrushConstants.FromBrushes(scene.HeightFieldBrushes);
|
||||
|
||||
var objectCount = Math.Min(scene.SdfObjects.Count, MaxSdfObjectCount);
|
||||
|
|
@ -2187,6 +2216,7 @@ public sealed class D3D12Renderer : IAquariumRenderer
|
|||
scenePipelineState!,
|
||||
temporalGaussianPipelineState!,
|
||||
localCastFusionPipelineState!,
|
||||
fractalSplatRenderPipelineState!,
|
||||
fractalSplatPipelineState!,
|
||||
fractalSdfReservoirPipelineState!,
|
||||
fractalPbrReservoirPipelineState!,
|
||||
|
|
@ -2207,6 +2237,7 @@ public sealed class D3D12Renderer : IAquariumRenderer
|
|||
scenePipelineState = pipelines.Scene;
|
||||
temporalGaussianPipelineState = pipelines.TemporalGaussian;
|
||||
localCastFusionPipelineState = pipelines.LocalCastFusion;
|
||||
fractalSplatRenderPipelineState = pipelines.FractalSplatRender;
|
||||
fractalSplatPipelineState = pipelines.FractalSplat;
|
||||
fractalSdfReservoirPipelineState = pipelines.FractalSdfReservoir;
|
||||
fractalPbrReservoirPipelineState = pipelines.FractalPbrReservoir;
|
||||
|
|
@ -2230,6 +2261,7 @@ public sealed class D3D12Renderer : IAquariumRenderer
|
|||
scenePipelineState = null;
|
||||
temporalGaussianPipelineState = null;
|
||||
localCastFusionPipelineState = null;
|
||||
fractalSplatRenderPipelineState = null;
|
||||
fractalSplatPipelineState = null;
|
||||
fractalSdfReservoirPipelineState = null;
|
||||
fractalPbrReservoirPipelineState = null;
|
||||
|
|
@ -2549,6 +2581,11 @@ public sealed class D3D12Renderer : IAquariumRenderer
|
|||
return CreateFullscreenPipelineState(path, "D3D12TemporalGaussianVS", "D3D12TemporalGaussianPS", [SceneHdrFormat, SceneHdrFormat, SceneHdrFormat, SceneHdrFormat], enableDepth: true);
|
||||
}
|
||||
|
||||
private ID3D12PipelineState CreateFractalSplatRenderPipelineState(string path)
|
||||
{
|
||||
return CreateFullscreenPipelineState(path, "D3D12FractalSplatVS", "D3D12FractalSplatPS", [SceneHdrFormat, SceneHdrFormat, SceneHdrFormat, SceneHdrFormat], enableDepth: true);
|
||||
}
|
||||
|
||||
private ID3D12PipelineState CreateLocalCastFusionPipelineState(string path)
|
||||
{
|
||||
var computeShader = CompileShader(path, "D3D12LocalCastFusionCS", "cs_5_0");
|
||||
|
|
@ -2753,7 +2790,8 @@ public sealed class D3D12Renderer : IAquariumRenderer
|
|||
float BloomVeilIntensity,
|
||||
Vector4 CursorWorlds,
|
||||
Vector4 TemporalGaussianInfo,
|
||||
Vector4 GpuFusionInfo);
|
||||
Vector4 GpuFusionInfo,
|
||||
Vector4 FractalReservoirInfo);
|
||||
|
||||
private sealed record D3D12ShaderPaths(
|
||||
string HeightField,
|
||||
|
|
@ -2761,6 +2799,7 @@ public sealed class D3D12Renderer : IAquariumRenderer
|
|||
string TemporalGaussian,
|
||||
string LocalCastFusion,
|
||||
string FractalReservoir,
|
||||
string FractalSplatRender,
|
||||
string SdfCommon,
|
||||
string SdfProxy,
|
||||
IReadOnlyList<string> SdfShaders,
|
||||
|
|
@ -2768,7 +2807,7 @@ public sealed class D3D12Renderer : IAquariumRenderer
|
|||
IReadOnlyList<string> Includes,
|
||||
string Post)
|
||||
{
|
||||
public IReadOnlyList<string> All { get; } = [HeightField, Scene, TemporalGaussian, LocalCastFusion, FractalReservoir, SdfCommon, SdfProxy, ..SdfShaders, SdfMath, ..Includes, Post];
|
||||
public IReadOnlyList<string> All { get; } = [HeightField, Scene, TemporalGaussian, LocalCastFusion, FractalReservoir, FractalSplatRender, SdfCommon, SdfProxy, ..SdfShaders, SdfMath, ..Includes, Post];
|
||||
|
||||
public static D3D12ShaderPaths FromManifest(string root, AquariumShaderManifest manifest)
|
||||
{
|
||||
|
|
@ -2782,6 +2821,7 @@ public sealed class D3D12Renderer : IAquariumRenderer
|
|||
shaderPath(manifest.TemporalGaussianShader),
|
||||
shaderPath(manifest.LocalCastFusionShader),
|
||||
shaderPath(manifest.FractalReservoirShader),
|
||||
shaderPath(manifest.FractalSplatRenderShader),
|
||||
shaderPath(manifest.SdfCommonInclude),
|
||||
shaderPath(manifest.SdfProxyInclude),
|
||||
manifest.SdfShaderPaths.Select(shaderPath).ToArray(),
|
||||
|
|
@ -2797,6 +2837,7 @@ public sealed class D3D12Renderer : IAquariumRenderer
|
|||
ID3D12PipelineState Scene,
|
||||
ID3D12PipelineState TemporalGaussian,
|
||||
ID3D12PipelineState LocalCastFusion,
|
||||
ID3D12PipelineState FractalSplatRender,
|
||||
ID3D12PipelineState FractalSplat,
|
||||
ID3D12PipelineState FractalSdfReservoir,
|
||||
ID3D12PipelineState FractalPbrReservoir,
|
||||
|
|
@ -2819,6 +2860,7 @@ public sealed class D3D12Renderer : IAquariumRenderer
|
|||
FractalPbrReservoir.Dispose();
|
||||
FractalSdfReservoir.Dispose();
|
||||
FractalSplat.Dispose();
|
||||
FractalSplatRender.Dispose();
|
||||
LocalCastFusion.Dispose();
|
||||
TemporalGaussian.Dispose();
|
||||
foreach (var sdfProxy in SdfProxies)
|
||||
|
|
@ -2865,6 +2907,8 @@ public sealed class D3D12Renderer : IAquariumRenderer
|
|||
|
||||
public D3D12DescriptorSlot TemporalGaussianUnorderedAccessDescriptor { get; set; }
|
||||
|
||||
public D3D12DescriptorSlot FractalSplatDescriptor { get; set; }
|
||||
|
||||
public D3D12DescriptorSlot StudioPmremDescriptor { get; set; }
|
||||
|
||||
public D3D12DescriptorSlot StudioIrradianceDescriptor { get; set; }
|
||||
|
|
|
|||
132
src/Aquarium.Engine/Render/Shaders/D3D12FractalSplatRender.hlsl
Normal file
132
src/Aquarium.Engine/Render/Shaders/D3D12FractalSplatRender.hlsl
Normal file
|
|
@ -0,0 +1,132 @@
|
|||
cbuffer AquariumFrame : register(b0)
|
||||
{
|
||||
float2 resolution;
|
||||
float timeSeconds;
|
||||
float viewRadius;
|
||||
float3 cameraPosition;
|
||||
float farDistance;
|
||||
float3 cameraTarget;
|
||||
float sceneFlags;
|
||||
float2 viewCenter;
|
||||
float frameIndex;
|
||||
float previousTimeSeconds;
|
||||
float3 previousCameraPosition;
|
||||
float previousViewRadius;
|
||||
float3 previousCameraTarget;
|
||||
float previousSceneFlags;
|
||||
float2 previousViewCenter;
|
||||
float2 jitterPixels;
|
||||
float2 previousJitterPixels;
|
||||
float renderDebugMode;
|
||||
float exposure;
|
||||
float bloomIntensity;
|
||||
float bloomVeilIntensity;
|
||||
float4 cursorWorlds;
|
||||
float4 temporalGaussianInfo;
|
||||
float4 gpuFusionInfo;
|
||||
float4 fractalReservoirInfo;
|
||||
};
|
||||
|
||||
struct FractalSdfSplat
|
||||
{
|
||||
float4 centerRadius;
|
||||
float4 orientation;
|
||||
float4 radiiFalloff;
|
||||
float4 materialConfidence;
|
||||
float4 key;
|
||||
};
|
||||
|
||||
StructuredBuffer<FractalSdfSplat> fractalSdfSplats : register(t25);
|
||||
|
||||
struct FractalSplatVertexOut
|
||||
{
|
||||
float4 position : SV_Position;
|
||||
nointerpolation uint splatIndex : TEXCOORD0;
|
||||
float2 quad : TEXCOORD1;
|
||||
float travel : TEXCOORD2;
|
||||
};
|
||||
|
||||
struct SceneOut
|
||||
{
|
||||
float4 colorTravel : SV_Target0;
|
||||
float4 metadata : SV_Target1;
|
||||
float4 control : SV_Target2;
|
||||
float4 reservoirGuide : SV_Target3;
|
||||
float depth : SV_Depth;
|
||||
};
|
||||
|
||||
static const float FIELD_ID_FRACTAL_SPLAT_BASE = 4000.0;
|
||||
|
||||
void cameraBasis(float3 camera, float3 target, out float3 forward, out float3 right, out float3 up)
|
||||
{
|
||||
forward = normalize(target - camera);
|
||||
right = normalize(cross(forward, float3(0.0, 0.0, 1.0)));
|
||||
up = cross(right, forward);
|
||||
}
|
||||
|
||||
uint VisibleSplatIndex(uint instanceId)
|
||||
{
|
||||
uint splatCount = max((uint)fractalReservoirInfo.x, 1u);
|
||||
uint visibleCount = max((uint)fractalReservoirInfo.y, 1u);
|
||||
return min((instanceId * splatCount) / visibleCount, splatCount - 1u);
|
||||
}
|
||||
|
||||
FractalSplatVertexOut D3D12FractalSplatVS(uint vertexId : SV_VertexID, uint instanceId : SV_InstanceID)
|
||||
{
|
||||
float2 corners[6] =
|
||||
{
|
||||
float2(-1.0, -1.0),
|
||||
float2(1.0, -1.0),
|
||||
float2(1.0, 1.0),
|
||||
float2(-1.0, -1.0),
|
||||
float2(1.0, 1.0),
|
||||
float2(-1.0, 1.0),
|
||||
};
|
||||
|
||||
uint splatIndex = VisibleSplatIndex(instanceId);
|
||||
FractalSdfSplat splat = fractalSdfSplats[splatIndex];
|
||||
float3 forward;
|
||||
float3 right;
|
||||
float3 up;
|
||||
cameraBasis(cameraPosition, cameraTarget, forward, right, up);
|
||||
float worldScale = max(viewRadius * 0.16, 0.05);
|
||||
float3 center = cameraTarget + splat.centerRadius.xyz * worldScale;
|
||||
float3 delta = center - cameraPosition;
|
||||
float z = max(dot(delta, forward), 0.0001);
|
||||
float2 projected = float2(dot(delta, right), dot(delta, up)) / z * 1.6;
|
||||
float clipAspect = resolution.x / max(resolution.y, 1.0);
|
||||
float boundRadius = max(splat.centerRadius.w * worldScale * 1.8, 0.002 * viewRadius);
|
||||
float projectedRadius = boundRadius / z * 1.6 + 0.002;
|
||||
float2 clipCenter = float2(projected.x / clipAspect, projected.y);
|
||||
float2 clipRadius = float2(projectedRadius / clipAspect, projectedRadius);
|
||||
|
||||
FractalSplatVertexOut output;
|
||||
output.position = float4(clipCenter + corners[vertexId] * clipRadius, 0.0, 1.0);
|
||||
output.splatIndex = splatIndex;
|
||||
output.quad = corners[vertexId];
|
||||
output.travel = z;
|
||||
return output;
|
||||
}
|
||||
|
||||
SceneOut D3D12FractalSplatPS(FractalSplatVertexOut input)
|
||||
{
|
||||
float r2 = dot(input.quad, input.quad);
|
||||
if (r2 >= 1.0)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
|
||||
FractalSdfSplat splat = fractalSdfSplats[input.splatIndex];
|
||||
float weight = pow(saturate(1.0 - r2), max(splat.radiiFalloff.w * 0.35, 0.5));
|
||||
float material = saturate(splat.materialConfidence.x);
|
||||
float3 color = lerp(float3(0.05, 0.42, 1.0), float3(1.0, 0.72, 0.18), material);
|
||||
float opacity = saturate(weight * 0.34);
|
||||
|
||||
SceneOut output;
|
||||
output.colorTravel = float4(color * opacity, min(input.travel, farDistance + 1.0));
|
||||
output.metadata = float4(FIELD_ID_FRACTAL_SPLAT_BASE, normalize(float3(input.quad, 1.0)));
|
||||
output.control = float4(opacity, saturate(splat.materialConfidence.w), saturate(splat.centerRadius.w * 40.0), 0.0);
|
||||
output.reservoirGuide = float4(saturate(splat.materialConfidence.w), 0.0, 1.0, 0.0);
|
||||
output.depth = saturate(input.travel / max(farDistance, 0.0001));
|
||||
return output;
|
||||
}
|
||||
|
|
@ -168,11 +168,11 @@ float3 zyFractalDomainDebug(float3 dir)
|
|||
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));
|
||||
float gridLine = 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);
|
||||
return saturate(faceColor * 0.28 + gridLine.xxx * 0.34 + brushColor);
|
||||
}
|
||||
|
||||
float zyTileRelief(float2 uv, float level, float amplitude, float ridgeBias)
|
||||
|
|
|
|||
|
|
@ -180,3 +180,4 @@
|
|||
{"timestamp":"2026-05-20T01:24:49+01:00","topic":"fractal-reservoir-shader-asset","lesson":"The fractal GPU reservoir compute path must live as an engine shader asset, not as embedded receipt-tool text. `src/Aquarium.Engine/Render/Shaders/D3D12FractalReservoirCompute.hlsl` now owns the splat population pass plus the independent SDF envelope, PBR material, and radiosity reservoir update passes. `tools/Aquarium.Fractal.Receipt` compiles that shader file directly, keeping the receipt and future renderer pass on one source of truth.","files":["src/Aquarium.Engine/Render/Shaders/D3D12FractalReservoirCompute.hlsl","tools/Aquarium.Fractal.Receipt/Program.cs","state/map.yaml"],"source":"continued Perfect Machine build after the GPU receipt proved the pass should become reusable renderer architecture"}
|
||||
{"timestamp":"2026-05-20T01:31:00+01:00","topic":"fractal-reservoir-render-contract","lesson":"The render contract now exposes `AquariumFractalReservoirField` on `AquariumSceneState`: clients request a GPU-resident fractal reservoir field by resident splat count, depth, seed, reservoir candidates/update, and updates/pass. This keeps million-instance splat population inside GPU compute instead of making clients publish CPU splat lists.","files":["src/Aquarium.Engine.Contracts/Render/AquariumRenderPlan.cs","tests/Aquarium.Engine.Fractal.Tests/FractalReservoirFieldContractTests.cs","state/map.yaml"],"source":"continued Perfect Machine build: the shared shader needed a client-to-renderer contract surface"}
|
||||
{"timestamp":"2026-05-20T01:57:56+01:00","topic":"renderer-owned-fractal-reservoir-pass","lesson":"D3D12Renderer now owns the first live fractal reservoir compute pass instead of leaving it in the receipt tool. The renderer creates a separate fractal reservoir root signature, compiles four compute pipelines from `D3D12FractalReservoirCompute.hlsl`, lazily allocates GPU UAV buffers for splats plus SDF/PBR/radiosity reservoirs, inserts a UAV barrier after splat population, and dispatches the three independent reservoir passes when `AquariumFractalReservoirField` is present. Zyphos now requests the 2,000,000-splat, 50,000-updates/pass field by default. The pass still needs a shaded consumption path before it produces visible terrain pixels.","files":["src/Aquarium.Engine/Render/D3D12Renderer.cs","src/Aquarium.Engine/Render/D3D12StructuredBuffer.cs","src/Aquarium.Engine.Contracts/Render/AquariumApp.cs","src/Aquarium.Engine.Contracts/Render/AquariumRenderPlan.cs","src/Aquarium.Zyphos/ZyphosSceneBuilder.cs","tests/Aquarium.Engine.Fractal.Tests/ZyphosFractalTerrainTests.cs","tools/Aquarium.Fractal.Receipt/Program.cs","state/map.yaml"],"source":"continued Perfect Machine build: turn the GPU reservoir receipt into a renderer-owned frame pass"}
|
||||
{"timestamp":"2026-05-20T02:08:12+01:00","topic":"visible-fractal-splat-consumption","lesson":"The first visible GPU-resident fractal consumption path is now a capped debug draw, not a CPU readback. `D3D12FractalSplatRender.hlsl` reads the computed `AquariumPackedFractalSdfSplat3D` buffer as an SRV and draws up to 131,072 splat instances into the scene. This proves the renderer can consume the compute-populated splat buffer directly; final terrain, material, and radiosity integration still need domain-correct shading over the same buffers. A Zyphos shader compile bug also surfaced here: `line` was treated as an HLSL token, so the planet debug variable is now `gridLine`.","files":["src/Aquarium.Engine/Render/Shaders/D3D12FractalSplatRender.hlsl","src/Aquarium.Engine/Render/D3D12Renderer.cs","src/Aquarium.Engine.Contracts/Render/AquariumApp.cs","src/Aquarium.Engine.Contracts/Render/AquariumRenderPlan.cs","src/Aquarium.Zyphos/Shaders/D3D12ZyphosPlanet.hlsl","state/map.yaml"],"source":"continued Perfect Machine build: make the GPU-resident fractal splat buffer visible in the renderer"}
|
||||
|
|
|
|||
|
|
@ -140,6 +140,7 @@ renderer_state:
|
|||
- 2D-projected-to-3D splats have a pure compiler seam: FractalProjectedSdfSplatCompiler maps resident SignedDistance2D page payload samples through an explicit page-to-world function and normal into bounded AquariumFractalSdfSplat3D packets.
|
||||
- AquariumSceneState now carries AquariumFractalReservoirField as the narrow client-to-renderer request for GPU-resident fractal reservoirs: resident splat count, IFS depth/seed, candidates per reservoir update, and stochastic updates per pass. This is a budgeted GPU field request, not a CPU splat list.
|
||||
- D3D12Renderer owns the first live fractal reservoir compute hook: a separate root signature, four compute pipelines from D3D12FractalReservoirCompute.hlsl, lazy UAV buffers for splats/SDF/PBR/radiosity reservoirs, a UAV barrier after splat population, and per-frame dispatch when AquariumFractalReservoirField is present. Zyphos requests the 2M-splat, 50k-updates/pass field by default.
|
||||
- The renderer now has a first visible consumption path for computed fractal splats: D3D12FractalSplatRender.hlsl reads the GPU-resident splat buffer as an SRV and draws a capped 131,072-instance debug splat subset into the scene after the reservoir compute update. This is an observability/render-consumption proof, not the final terrain/material/radiosity shading path.
|
||||
- The consolidated fractal brush architecture plan defines the intended pipeline: client intent -> domain roots -> semantic IFS brush grammar -> ownership tree -> node summaries -> contribution cache/residency scheduler -> backend packets -> renderer passes -> debug/evidence, with explicit module boundaries and mockable unit-test seams.
|
||||
- The Perfect Machine architecture lives in docs/perfect-machine-architecture.md. It is the current waterfall design authority for fast 2D SDF splats, 3D SDF splats, 2D-projected-to-3D surface splats, IFS `.aquageo` structural probes, Mimir-style camera/audio evidence candidates, ReSTIR/GRIS reservoir reuse, heuristic occupancy graph updates, resource-tier residency, and TAA guide-buffer integration.
|
||||
- Fractal surface page planning now has a CPU boundary: FractalSurfacePagePlanner lowers selected IFS cuts into stable height, 2D signed-distance, material, and confidence page metadata; ZyphosFractalRenderPlan exposes these pages, while the live D3D12 page store and atlas remain future work.
|
||||
|
|
|
|||
Loading…
Reference in a new issue