From 0ce37b4f46a522ceacac89d8ac678ea93d14d1e0 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 13 May 2026 02:54:04 +0100 Subject: [PATCH] Make Self an orrery authority body --- docs/epiphany-agent-sdf-visual-language.md | 18 ++-- .../Shaders/D3D12SelfBody.hlsl | 101 ++++++++++++++---- state/evidence.jsonl | 1 + state/memory.json | 1 + 4 files changed, 93 insertions(+), 28 deletions(-) diff --git a/docs/epiphany-agent-sdf-visual-language.md b/docs/epiphany-agent-sdf-visual-language.md index 7cfb3f9..0e499c0 100644 --- a/docs/epiphany-agent-sdf-visual-language.md +++ b/docs/epiphany-agent-sdf-visual-language.md @@ -332,10 +332,11 @@ Role ids: `coordinator`, `epiphany.self` Purpose: routing, authority, checkpoint, run state, and review boundary. -Appearance: a central routing heart made of a warm core sphere crossed by -several smooth torus arcs. The arcs look like quiet rails orbiting a command -seed, with small gate nodes at their intersections. Self should feel central -and decisive, not busy. +Appearance: a central routing heart made of a warm command sphere inside a +fantasy orrery. Smooth torus arcs and tilted orbital rings cross around the +core like authority rails, with small gate/eye nodes riding the orbits. It +should carry a controlled many-eyed angelic read: radiant, watchful, and +decisive, but not a uniform glow cloud. Reasoning: Self is not a worker lane. It preserves agency by routing work, rejecting bad authority claims, and deciding which organ deserves the next @@ -346,11 +347,14 @@ Math: - Exact sphere core with radius `1.0`. - Four torus arcs in tilted planes, clipped by angular masks. -- Smooth union between the core and small gate-node spheres. +- Several thinner tilted orrery rings around the core. +- Smooth union between the core, small gate-node spheres, and eye beads. - Thin emissive routing filaments as torus-segment SDFs with sinusoidal radius modulation along the arc. -- Material regions: warm ceramic core, gold-orange routing rails, bright current - target gate, dark review seam. +- Material regions: warm ceramic core, metallic gold/orichalcum routing rails, + dimmer orrery rings, pale gate/eye bodies, bright current target pupils, and + dark review seam. Emission is an accent on rails, pupils, and active gates; + it must not wash out component boundaries. Movement: diff --git a/src/Aquarium.Epiphany/Shaders/D3D12SelfBody.hlsl b/src/Aquarium.Epiphany/Shaders/D3D12SelfBody.hlsl index 298b8cf..e807aa9 100644 --- a/src/Aquarium.Epiphany/Shaders/D3D12SelfBody.hlsl +++ b/src/Aquarium.Epiphany/Shaders/D3D12SelfBody.hlsl @@ -7,7 +7,9 @@ struct SelfParts { float core; float rail; + float halo; float gate; + float pupil; float seam; float distanceValue; }; @@ -29,24 +31,53 @@ float3 rotateZ(float3 p, float angle) return float3(p.x * c - p.y * s, p.x * s + p.y * c, p.z); } -float sdRoutingArc(float3 local, float angle, float tilt, float pressure, float phase) +float3 selfOrbitPlane(float3 local, float angle, float tilt) { float3 p = rotateZ(local, angle); - float3 q = float3(p.x, p.z * cos(tilt) - p.y * sin(tilt), p.z * sin(tilt) + p.y * cos(tilt)); + return float3(p.x, p.z * cos(tilt) - p.y * sin(tilt), p.z * sin(tilt) + p.y * cos(tilt)); +} + +float3 selfOrbitPoint(float angle, float tilt, float orbitAngle, float orbitRadius) +{ + float3 q = float3(cos(orbitAngle) * orbitRadius, sin(orbitAngle) * orbitRadius, 0.0); + float3 p = float3(q.x, q.z * sin(tilt) + q.y * cos(tilt), q.z * cos(tilt) - q.y * sin(tilt)); + return rotateZ(p, -angle); +} + +float sdRoutingArc(float3 local, float angle, float tilt, float pressure, float phase) +{ + float3 q = selfOrbitPlane(local, angle, tilt); float majorRadius = lerp(0.82, 0.68, pressure); float tubeRadius = 0.025 + 0.006 * sin(phase + angle * 1.7); return sdTorusArc(q, majorRadius, tubeRadius, float2(1.0, 0.0), 1.22); } +float sdOrreryRing(float3 local, float angle, float tilt, float pressure, float radius, float tubeRadius) +{ + float3 q = selfOrbitPlane(local, angle, tilt); + return sdTorus(q, float2(lerp(radius, radius * 0.88, pressure), tubeRadius)); +} + float gateNode(float3 local, float angle, float tilt, float pressure) { float majorRadius = lerp(0.82, 0.68, pressure); - float3 p = float3(majorRadius, 0.0, 0.0); - float3 untilt = float3(p.x, p.z * sin(tilt) + p.y * cos(tilt), p.z * cos(tilt) - p.y * sin(tilt)); - float3 node = rotateZ(untilt, -angle); + float3 node = selfOrbitPoint(angle, tilt, 0.0, majorRadius); return sdSphere(local - node, 0.075); } +float eyeNode(float3 local, float angle, float tilt, float orbitAngle, float orbitRadius) +{ + float3 node = selfOrbitPoint(angle, tilt, orbitAngle, orbitRadius); + return sdEllipsoid(local - node, float3(0.075, 0.050, 0.038)); +} + +float eyePupil(float3 local, float angle, float tilt, float orbitAngle, float orbitRadius) +{ + float3 node = selfOrbitPoint(angle, tilt, orbitAngle, orbitRadius); + float3 outward = normalize(node); + return sdSphere(local - node - outward * 0.034, 0.026); +} + SelfParts selfParts(float3 local, SdfObject sdfObject, float timeSeconds) { float activity = saturate(sdfObject.state.x); @@ -62,24 +93,45 @@ SelfParts selfParts(float3 local, SdfObject sdfObject, float timeSeconds) float arc3 = sdRoutingArc(local, -1.57, -0.34, pressure, phase + 3.6); float rail = min(min(arc0, arc1), min(arc2, arc3)); + float halo0 = sdOrreryRing(local, 0.42, 1.15, pressure, 0.98, 0.012); + float halo1 = sdOrreryRing(local, 2.12, -0.92, pressure, 0.92, 0.010); + float halo2 = sdOrreryRing(local, -1.18, 0.28, pressure, 0.74, 0.009); + float halo = min(halo0, min(halo1, halo2)); + float gate0 = gateNode(local, 0.00, 0.50, pressure); float gate1 = gateNode(local, 1.57, -0.58, pressure); float gate2 = gateNode(local, 3.14, 0.76, pressure); float gate3 = gateNode(local, -1.57, -0.34, pressure); float gate = min(min(gate0, gate1), min(gate2, gate3)); + float eye0 = eyeNode(local, 0.42, 1.15, 1.30 + phase * 0.08, 0.98); + float eye1 = eyeNode(local, 0.42, 1.15, -1.55 + phase * 0.08, 0.98); + float eye2 = eyeNode(local, 2.12, -0.92, 2.35 - phase * 0.06, 0.92); + float eye3 = eyeNode(local, -1.18, 0.28, -0.72 + phase * 0.05, 0.74); + gate = min(gate, min(min(eye0, eye1), min(eye2, eye3))); + + float pupil0 = eyePupil(local, 0.42, 1.15, 1.30 + phase * 0.08, 0.98); + float pupil1 = eyePupil(local, 0.42, 1.15, -1.55 + phase * 0.08, 0.98); + float pupil2 = eyePupil(local, 2.12, -0.92, 2.35 - phase * 0.06, 0.92); + float pupil3 = eyePupil(local, -1.18, 0.28, -0.72 + phase * 0.05, 0.74); + float pupil = min(min(pupil0, pupil1), min(pupil2, pupil3)); + float seamRing = sdTorus(local.xzy, float2(0.63, 0.012)); float seamMask = abs(local.z) - 0.10; float seam = max(seamRing, -seamMask); float routed = smoothUnion(core, rail, 0.045); - routed = smoothUnion(routed, gate, 0.040); + routed = smoothUnion(routed, halo, 0.020); + routed = smoothUnion(routed, gate, 0.036); + routed = smoothUnion(routed, pupil, 0.010); float distanceValue = smoothUnion(routed, seam, lerp(0.012, 0.030, activity)); SelfParts parts; parts.core = core; parts.rail = rail; + parts.halo = halo; parts.gate = gate; + parts.pupil = pupil; parts.seam = seam; parts.distanceValue = distanceValue; return parts; @@ -99,25 +151,32 @@ SdfSurface sdfSurface(float3 p, int sdfIndex) float radius = max(sdfObject.centerRadius.w, 0.001); float3 local = (p - sdfObject.centerRadius.xyz) / radius; SelfParts parts = selfParts(local, sdfObject, timeSeconds); - float isGate = parts.gate <= min(min(parts.core, parts.rail), parts.seam) ? 1.0 : 0.0; - float isRail = (1.0 - isGate) * (parts.rail <= min(parts.core, parts.seam) ? 1.0 : 0.0); - float isSeam = (1.0 - isGate) * (1.0 - isRail) * (parts.seam <= parts.core ? 1.0 : 0.0); - float isCore = (1.0 - isGate) * (1.0 - isRail) * (1.0 - isSeam); + float nonCore = min(min(parts.rail, parts.halo), min(parts.gate, min(parts.pupil, parts.seam))); + float isPupil = parts.pupil <= min(min(parts.core, parts.rail), min(parts.halo, min(parts.gate, parts.seam))) ? 1.0 : 0.0; + float isGate = (1.0 - isPupil) * (parts.gate <= min(min(parts.core, parts.rail), min(parts.halo, parts.seam)) ? 1.0 : 0.0); + float isRail = (1.0 - isPupil) * (1.0 - isGate) * (parts.rail <= min(min(parts.core, parts.halo), parts.seam) ? 1.0 : 0.0); + float isHalo = (1.0 - isPupil) * (1.0 - isGate) * (1.0 - isRail) * (parts.halo <= min(parts.core, parts.seam) ? 1.0 : 0.0); + float isSeam = (1.0 - isPupil) * (1.0 - isGate) * (1.0 - isRail) * (1.0 - isHalo) * (parts.seam <= min(parts.core, nonCore) ? 1.0 : 0.0); + float isCore = (1.0 - isPupil) * (1.0 - isGate) * (1.0 - isRail) * (1.0 - isHalo) * (1.0 - isSeam); float glow = 0.5 + 0.5 * sin(timeSeconds * 1.4 + local.x * 2.0 - local.y * 1.5 + local.z * 2.5); - float3 coreColor = lerp(float3(1.0, 0.58, 0.26), float3(1.0, 0.88, 0.62), glow); - float3 railColor = float3(1.0, 0.62, 0.18); - float3 gateColor = lerp(float3(1.0, 0.82, 0.24), float3(1.0, 0.96, 0.68), saturate(sdfObject.state.x)); - float3 seamColor = float3(0.09, 0.045, 0.032); + float3 coreColor = lerp(float3(0.82, 0.46, 0.24), float3(1.0, 0.72, 0.42), glow); + float3 railColor = float3(0.96, 0.58, 0.20); + float3 haloColor = float3(0.70, 0.53, 0.34); + float3 gateColor = lerp(float3(0.90, 0.78, 0.54), float3(1.0, 0.92, 0.68), saturate(sdfObject.state.x)); + float3 pupilColor = float3(0.10, 0.045, 0.018); + float3 seamColor = float3(0.06, 0.028, 0.020); SdfSurface surface; - surface.baseColor = coreColor * isCore + railColor * isRail + gateColor * isGate + seamColor * isSeam; - surface.metallic = 0.0; - surface.roughness = 0.34 * isCore + 0.22 * isRail + 0.16 * isGate + 0.74 * isSeam; + surface.baseColor = coreColor * isCore + railColor * isRail + haloColor * isHalo + gateColor * isGate + pupilColor * isPupil + seamColor * isSeam; + surface.metallic = 0.0 * isCore + 0.65 * isRail + 0.82 * isHalo + 0.0 * isGate + 0.0 * isPupil + 0.0 * isSeam; + surface.roughness = 0.42 * isCore + 0.26 * isRail + 0.22 * isHalo + 0.18 * isGate + 0.32 * isPupil + 0.78 * isSeam; surface.emission = primitiveEmissionRadiance(sdfFieldId(sdfIndex)) - + coreColor * isCore * 0.40 - + railColor * isRail * 1.15 - + gateColor * isGate * (1.35 + sdfObject.state.y * 0.45) - + seamColor * isSeam * 0.03; + + coreColor * isCore * 0.10 + + railColor * isRail * 0.42 + + haloColor * isHalo * 0.10 + + gateColor * isGate * (0.34 + sdfObject.state.y * 0.18) + + float3(1.0, 0.62, 0.14) * isPupil * (1.4 + sdfObject.state.y * 0.30) + + seamColor * isSeam * 0.01; return surface; } diff --git a/state/evidence.jsonl b/state/evidence.jsonl index 7f395a2..638b270 100644 --- a/state/evidence.jsonl +++ b/state/evidence.jsonl @@ -80,3 +80,4 @@ {"timestamp":"2026-05-13T02:08:00+01:00","topic":"imagination-continuous-ribbon-field","lesson":"The hibiscus cursor lesson applies to Imagination: use a continuous sheet parameterization when it can own the form. Replacing piecewise rim capsule chains with one pair-space field for film and raised edge distance removed straight posts, made the ribbon silhouette more coherent, and reduced headless reload time instead of adding compensating geometry.","files":["src/Aquarium.Epiphany/Shaders/D3D12ImaginationAgent.hlsl","state/memory.json","state/evidence.jsonl"],"source":"user challenged piecewise construction after visual review"} {"timestamp":"2026-05-13T02:13:00+01:00","topic":"continuous-form-first-rule","lesson":"Carve this into local practice: when a spec describes a continuous visual, physical, or simulation form, start with continuous field math or a coherent parameterization that owns the form. Piecewise capsules, boxes, slabs, helper organs, adapters, and compensators are not acceptable lazy shortcuts; use them only when the form is actually piecewise or measured constraints force a documented cut.","files":["AGENTS.md","state/memory.json","state/evidence.jsonl"],"source":"user instruction after Imagination correction"} {"timestamp":"2026-05-13T02:40:00+01:00","topic":"self-routing-heart-sdf","lesson":"Self should not be a raw emissive placeholder sphere. Its live SDF is the routing authority object: a warm central sphere, continuous clipped torus-arc rails, gate nodes, and dark review seam, all returning standard PBR material fields plus emission. This keeps Self central and radiant without leaking special shading bypasses.","files":["src/Aquarium.Epiphany/Shaders/D3D12SelfBody.hlsl","state/memory.json","state/evidence.jsonl"],"source":"user asked to prioritize Self visual body"} +{"timestamp":"2026-05-13T02:56:00+01:00","topic":"self-orrery-material-legibility","lesson":"Self needs fantasy orrery / many-eyed angelic authority, but material legibility matters more than raw glow. Add continuous tilted rings and eye/gate nodes, make rails/halos metallic, keep the core ceramic-warm, reserve strong emission for pupils and active routing accents, and update the visual spec so future passes do not flatten the components back into a glow cloud.","files":["src/Aquarium.Epiphany/Shaders/D3D12SelfBody.hlsl","docs/epiphany-agent-sdf-visual-language.md","state/memory.json","state/evidence.jsonl"],"source":"user visual correction"} diff --git a/state/memory.json b/state/memory.json index f81c4ad..4c9da03 100644 --- a/state/memory.json +++ b/state/memory.json @@ -64,6 +64,7 @@ "Do not reintroduce Imagination's old polar-lobed seed or traced half-torus shadow. The seed is a plain luminous opal bud unless the spec asks otherwise; backlog shadow needs a visual contract before it becomes traced geometry.", "Imagination's ribbon sheets should use one continuous pair-space field for film and raised edge rims. Do not rebuild the bloom from piecewise rim capsules or straight root/tip posts when the sheet parameterization can own the silhouette directly.", "Self's body is the routing authority object: a warm central sphere crossed by continuous clipped torus-arc rails, bright gate nodes, and a dark review seam. Keep it decisive and radiant through PBR surface regions plus emission; do not collapse it back to a raw emissive placeholder sphere.", + "Self should read as a fantasy orrery with controlled many-eyed angelic authority: tilted metallic rings and rails around a warm command core, pale gate/eye bodies, bright pupils/active gates, and restrained emission that accents structure instead of flattening it into glow.", "Heavy/specialized SDF evaluators should not live inside generic packed-id helpers when those helpers are called repeatedly; avoid shader compiler path cloning.", "Lighting is diegetic. Self is the initial emitter; later other Selves should emit through an explicit body light lane, not generic field instances or ambient convenience fill.", "Keep bundled blue-noise texture assets available for future dithering/noise work even when no current pass samples them.",