Integrate Life aperture into shell domain

This commit is contained in:
Meta Vens 2026-05-14 04:14:39 +01:00
commit 779bd3d739
3 changed files with 24 additions and 8 deletions

View file

@ -9,6 +9,7 @@ struct LifeDomain
float shell;
float rib;
float rim;
float cup;
float bead;
float crack;
float whorl;
@ -86,6 +87,16 @@ float lifeBeads(float3 local)
return max(max(rimDistance, side), max(arcGate * 0.05, beadPeriod * 0.030));
}
float lifeCup(float3 local)
{
float2 q = (local.xz - float2(-0.345, 0.060)) / float2(0.355, 0.450);
float footprint = (length(q) - 1.0) * 0.35;
float dish = saturate(1.0 - dot(q, q));
float shellY = -0.245 + dish * 0.110;
float sheet = abs(local.y - shellY) - 0.018;
return max(footprint, sheet);
}
float lifeCrack(float3 local, float shellDistance)
{
float2 uv = float2(local.x + 0.045, local.z - 0.010);
@ -107,6 +118,7 @@ LifeDomain lifeDomain(float3 local, SdfObject sdfObject)
float seamLine;
float rim = lifeRim(local, shell, whorl, seamLine);
float bead = lifeBeads(local);
float cup = lifeCup(local);
float crack = lifeCrack(local, shell);
float ribLift = (1.0 - smoothstep(0.0, 0.020, rib)) * 0.010;
float rimLift = (1.0 - smoothstep(0.0, 0.018, rim)) * 0.016;
@ -114,10 +126,11 @@ LifeDomain lifeDomain(float3 local, SdfObject sdfObject)
float crackedShell = shell - ribLift - rimLift;
LifeDomain domain;
domain.body = crackedShell - beadLift;
domain.body = smoothUnion(crackedShell - beadLift, cup, 0.035);
domain.shell = crackedShell;
domain.rib = rib;
domain.rim = rim;
domain.cup = cup;
domain.bead = bead;
domain.crack = crack;
domain.whorl = whorl;
@ -145,11 +158,12 @@ SdfSurface sdfSurface(float3 p, int sdfIndex)
float pressure = saturate(sdfObject.state.z + (1.0 - heartbeat) * 0.14);
float isBead = 1.0 - smoothstep(0.000, 0.014, domain.bead);
float isRim = (1.0 - isBead) * (1.0 - smoothstep(0.000, 0.018, domain.rim));
float isRib = (1.0 - isBead) * (1.0 - isRim) * (1.0 - smoothstep(0.000, 0.022, domain.rib));
float isShell = (1.0 - isBead) * (1.0 - isRim) * (1.0 - isRib);
float isRim = (1.0 - isBead) * (1.0 - smoothstep(0.000, 0.020, domain.rim));
float isCup = (1.0 - isBead) * (1.0 - isRim) * (domain.cup <= domain.shell ? 1.0 : 0.0);
float isRib = (1.0 - isBead) * (1.0 - isRim) * (1.0 - isCup) * (1.0 - smoothstep(0.000, 0.022, domain.rib));
float isShell = (1.0 - isBead) * (1.0 - isRim) * (1.0 - isCup) * (1.0 - isRib);
float insideChamber = isShell * (1.0 - smoothstep(0.000, 0.055, abs(domain.chamber)));
float insideChamber = saturate(isCup + isShell * (1.0 - smoothstep(0.000, 0.055, abs(domain.chamber))));
float crackMask = isShell * (1.0 - insideChamber) * (1.0 - smoothstep(0.000, 0.012, domain.crack));
float nacre = 0.5 + 0.5 * sin(lifeSpiralPhase(domain.uv) * 7.0 + local.y * 9.0 + timeSeconds * 0.15);
@ -167,7 +181,7 @@ SdfSurface sdfSurface(float3 p, int sdfIndex)
+ ember * 0.0;
surface.baseColor = lerp(surface.baseColor, gold, crackMask * 0.58);
surface.metallic = 0.0 * isShell + 0.34 * saturate(isRim + isRib);
surface.roughness = 0.22 * isShell + 0.16 * insideChamber + 0.11 * saturate(isRim + isRib) + 0.10 * isBead;
surface.roughness = 0.22 * isShell + 0.14 * insideChamber + 0.11 * saturate(isRim + isRib) + 0.10 * isBead;
surface.emission = primitiveEmissionRadiance(sdfFieldId(sdfIndex)) * 0.03
+ teal * isShell * 0.020
+ gold * insideChamber * (0.42 + heartbeat * 0.36)

View file

@ -96,3 +96,4 @@
{"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"}
{"timestamp":"2026-05-14T01:50:00+01:00","topic":"life-shell-domain","lesson":"Life reads as a nautilus only when the shell footprint, aperture, and ornament share one log-polar grammar. A plain ellipsoid volume with spiral material masks reads as wallpaper; a raw spiral-band volume tears the form apart. Use the log-polar footprint for the silhouette, round it into depth, and let ribs, seam glow, cracks, bowl, ember, and rim pearls sample that same domain.","files":["src/Aquarium.Epiphany/Shaders/D3D12LifeAgent.hlsl","state/life-agent-sdf-notes.md","state/map.yaml","state/evidence.jsonl"],"source":"self-directed Life SDF iteration against imagegen reference and user build screenshots"}
{"timestamp":"2026-05-14T02:55:00+01:00","topic":"life-no-detached-ornament","lesson":"Life's nautilus shell must be one connected shell domain. Detached hoops, bead trails, and separate ember spheres are a sign that ornament escaped the governing field. The aperture lip is the shell's opened edge; pearls must be relief/material on that lip field, and inner light should be chamber shading, not freestanding geometry.","files":["src/Aquarium.Epiphany/Shaders/D3D12LifeAgent.hlsl","state/life-agent-sdf-notes.md","state/evidence.jsonl"],"source":"user called out disconnected elements as lazy spatial-domain construction"}
{"timestamp":"2026-05-14T04:10:00+01:00","topic":"life-aperture-authority","lesson":"Life's aperture is not a boolean cut face. Render it as a concave inner shell surface integrated into the same log-polar/aperture domain, with the nacre lip owning the boundary and the warm chamber sitting behind it. If chamber material has priority over lip material, the shell reads as a flat sliced object.","files":["src/Aquarium.Epiphany/Shaders/D3D12LifeAgent.hlsl","state/life-agent-sdf-notes.md","state/evidence.jsonl"],"source":"user build screenshots showed the aperture as a flat segmented golden cut"}

View file

@ -10,8 +10,9 @@ Working model:
- The logarithmic shell domain owns spiral ribs, seam glow, crack veins, and shell relief.
- The aperture needs a solid warm inner bowl or it collapses into empty black background in isolated previews.
- Detached pearl spheres and ember geometry are wrong for this form. Pearls, if present, must be relief/material on the aperture lip field; the ember should read as inner chamber light, not as a separate object.
- The aperture chamber must render as an integrated concave inner shell surface behind the lip. If the chamber material paints over the lip, the form turns into a flat golden cut face.
Latest preview used for judgment:
- `artifacts/agent-previews/Life/20260514-025212/life-front.png`
- `artifacts/agent-previews/Life/20260514-025212/life-mouth-oblique.png`
- `artifacts/agent-previews/Life/20260514-040851/life-front.png`
- `artifacts/agent-previews/Life/20260514-040851/life-mouth-oblique.png`