From 4f1bd9600cc21cdde06f44fcf8ece96f12a9f6a5 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 13 May 2026 04:15:17 +0100 Subject: [PATCH] Stabilize Self lattice shells --- docs/epiphany-agent-sdf-visual-language.md | 11 +++- .../Shaders/D3D12SelfBody.hlsl | 56 +++++++++++++------ state/evidence.jsonl | 1 + state/memory.json | 2 +- 4 files changed, 48 insertions(+), 22 deletions(-) diff --git a/docs/epiphany-agent-sdf-visual-language.md b/docs/epiphany-agent-sdf-visual-language.md index 3fe060f..3d839fd 100644 --- a/docs/epiphany-agent-sdf-visual-language.md +++ b/docs/epiphany-agent-sdf-visual-language.md @@ -349,9 +349,14 @@ Math: - Exact sphere core with continuous inlay/vein fields on its surface. - A compact log-spherical lattice maps local direction and logarithmic radius - into nested shell waves. Orbital rails are level sets where radial shell bands - cross angular harmonic bands; gate nodes are the crossing points between - multiple bands in that same lattice. + into stable nested shells. Orbital rails are level sets where fixed radial + shell strata cross angular harmonic bands; gate nodes are the crossing points + between multiple bands in that same lattice. +- Shell radius is structural, not animated. Phase may rotate each shell's + angular frame and add mild band distortion, but it must not move radial zero + crossings or create rings by expanding points into circles. Multiple + concentric shells should occupy orthogonal orbital frames so complexity nests + cleanly instead of colliding on one surface. - Smooth union is reserved for joining the core to lattice-derived rails, gates, inlays, and seam marks. Do not hand-place independent hoops or separate torus inventories when the form wants one coherent orbital grammar. diff --git a/src/Aquarium.Epiphany/Shaders/D3D12SelfBody.hlsl b/src/Aquarium.Epiphany/Shaders/D3D12SelfBody.hlsl index d5a3d46..1823721 100644 --- a/src/Aquarium.Epiphany/Shaders/D3D12SelfBody.hlsl +++ b/src/Aquarium.Epiphany/Shaders/D3D12SelfBody.hlsl @@ -27,11 +27,12 @@ float3x3 selfOrbitalFrame(float phase) normalize(float3(0.38, -0.74 * c.x, 0.56 * c.y))); } -float3 selfLatticeWaves(float3 dir, float shell, float phase) +float3 selfLatticeCoordinates(float3 dir, float shellIndex, float phase) { - float3x3 frame = selfOrbitalFrame(phase); + float3x3 frame = selfOrbitalFrame(phase + shellIndex * 2.0943951); float3 latitude = mul(frame, dir); - return sin(latitude * float3(5.0, 6.0, 7.0) + shell * float3(1.15, -1.45, 1.85) + phase * float3(0.31, -0.23, 0.17)); + float3 shellPhase = shellIndex * float3(1.3, 2.1, 3.4); + return latitude + 0.055 * sin(latitude.zxy * float3(3.0, 4.0, 5.0) + shellPhase + phase * 0.23); } float min3(float3 value) @@ -39,6 +40,28 @@ float min3(float3 value) return min(value.x, min(value.y, value.z)); } +float selfShellRadius(float shellIndex, float pressure) +{ + float radius = 0.64 + shellIndex * 0.22 + shellIndex * shellIndex * 0.035; + return lerp(radius, radius * 0.88, pressure); +} + +void selfShellField(float3 dir, float r, float shellIndex, float pressure, float phase, inout float rail, inout float gate) +{ + float shell = r - selfShellRadius(shellIndex, pressure); + float3 bands = abs(selfLatticeCoordinates(dir, shellIndex, phase)) * r; + float thickness = lerp(0.010, 0.016, saturate(shellIndex * 0.5)); + + float shellRail = length(float2(shell, min3(bands))) - thickness; + float crossing = min( + length(float2(bands.x, bands.y)), + min(length(float2(bands.y, bands.z)), length(float2(bands.z, bands.x)))); + float shellGate = length(float2(shell * 1.25, crossing * 0.72)) - (thickness * 1.9); + + rail = min(rail, shellRail); + gate = min(gate, shellGate); +} + SelfField selfField(float3 local, SdfObject sdfObject, float timeSeconds) { float activity = saturate(sdfObject.state.x); @@ -50,25 +73,22 @@ SelfField selfField(float3 local, SdfObject sdfObject, float timeSeconds) float3 dir = local / r; float shell = log(r / 0.54); float coreRadius = 0.50 + 0.020 * sin(timeSeconds * 0.75 + heartbeat * 6.28318); - float shellTightness = lerp(1.0, 1.18, pressure); + float rail = 10.0; + float gate = 10.0; - float3 waves = selfLatticeWaves(dir, shell, phase); - float angularBand = min3(abs(waves)); - float shellPhase = shell * (5.20 * shellTightness) + dot(waves, float3(0.18, -0.13, 0.15)); - float shellBand = abs(sin(shellPhase)) * r / (5.20 * shellTightness); + [unroll] + for (int i = 0; i < 3; i++) + { + selfShellField(dir, r, (float)i, pressure, phase, rail, gate); + } - float railScale = r * (0.20 + 0.08 * saturate(abs(dir.z))); - float rail = length(float2(shellBand, angularBand * railScale)) - 0.012; - - float crossing = min( - length(float2(abs(waves.x), abs(waves.y))), - min(length(float2(abs(waves.y), abs(waves.z))), length(float2(abs(waves.z), abs(waves.x))))); - float gate = length(float2(shellBand * 1.25, crossing * r * 0.18)) - (0.024 + activity * 0.010); + float3 coreBands = abs(selfLatticeCoordinates(dir, -1.0, phase)); + float angularBand = min3(coreBands); float coreShell = r - (coreRadius + 0.006); - float coreInk = min(angularBand, abs(sin(shell * 2.2 + dot(waves, float3(0.21, 0.21, 0.21)) + phase * 0.19))); + float coreInk = min(angularBand, abs(sin(shell * 2.2 + dot(coreBands, float3(0.21, 0.21, 0.21)) + phase * 0.19))); float inlay = length(float2(coreShell, coreInk * r * 0.11)) - 0.006; - float seam = length(float2(r - (coreRadius + 0.002), abs(waves.x) * r * 0.09)) - lerp(0.002, 0.006, activity); + float seam = length(float2(r - (coreRadius + 0.002), coreBands.x * r * 0.09)) - lerp(0.002, 0.006, activity); float core = sdSphere(local, coreRadius); float routed = smoothUnion(core, inlay, 0.006); @@ -84,7 +104,7 @@ SelfField selfField(float3 local, SdfObject sdfObject, float timeSeconds) field.seam = seam; field.distanceValue = routed; field.vein = 0.5 + 0.5 * sin(dot(dir, normalize(float3(0.37, 0.63, -0.68))) * 12.0 + shell * 1.7 + phase * 0.35); - field.glow = 0.5 + 0.5 * sin(shell * 2.1 + dot(waves, float3(0.42, 0.31, -0.27)) + phase * 0.55); + field.glow = 0.5 + 0.5 * sin(shell * 2.1 + dot(coreBands, float3(0.42, 0.31, -0.27)) + phase * 0.55); return field; } diff --git a/state/evidence.jsonl b/state/evidence.jsonl index f47974d..d843fb7 100644 --- a/state/evidence.jsonl +++ b/state/evidence.jsonl @@ -89,3 +89,4 @@ {"timestamp":"2026-05-13T03:42:00+01:00","topic":"self-seam-fix-without-neutering","lesson":"Fixing a branch seam by deleting angular richness is another lazy cut. Preserve Self's overwhelming orbital complexity by expressing additional rail families as continuous sin/cos and dot-product phase fields, not atan2/fract longitude fields. Seam removal should check the math, not neuter the topology.","files":["src/Aquarium.Epiphany/Shaders/D3D12SelfBody.hlsl","state/evidence.jsonl"],"source":"user noted Self became too sparse after seam fix"} {"timestamp":"2026-05-13T03:51:52+01:00","topic":"self-nested-log-shells-core","lesson":"The log-spherical lesson for Self is nested radial authority, not merely twisting more curves across one level. Rails and gates should occupy distinct inner, mid, and outer shell fields, while the core needs continuous inlay and vein material fields so it reads as a radiant command object instead of a dead sphere with an intermittent black strap.","files":["src/Aquarium.Epiphany/Shaders/D3D12SelfBody.hlsl","state/memory.json","state/evidence.jsonl"],"source":"user compared current Self to imagegen reference and called out one-level structure plus dead core material"} {"timestamp":"2026-05-13T03:59:28+01:00","topic":"self-lattice-not-hoop-inventory","lesson":"Nested structure is not achieved by naming inner/mid/outer shells and piling repeated trigonometry onto each one. Self's complexity should arise from a compact log-spherical lattice: radial shell waves crossed with angular harmonic bands. Rails, gates, seams, and inlays are thresholds of that shared field, not separate hand-authored hoop components.","files":["src/Aquarium.Epiphany/Shaders/D3D12SelfBody.hlsl","docs/epiphany-agent-sdf-visual-language.md","state/memory.json","state/evidence.jsonl"],"source":"user called out clown math and repeated piecewise components after nested-shell patch"} +{"timestamp":"2026-05-13T04:13:17+01:00","topic":"self-stable-nested-shells","lesson":"Self's lattice shells must be stable radial strata. If phase participates in the radial shell zero crossing, rings appear from nowhere as points expanding into circles before sliding into place. Keep radial shell radii structural, animate only angular frames and mild band distortion, and offset each concentric shell into an orthogonal frame so nested orbits do not collide on one surface.","files":["src/Aquarium.Epiphany/Shaders/D3D12SelfBody.hlsl","docs/epiphany-agent-sdf-visual-language.md","state/memory.json","state/evidence.jsonl"],"source":"user screenshot correction after first log-spherical lattice pass"} diff --git a/state/memory.json b/state/memory.json index 7e7d876..fbb03c2 100644 --- a/state/memory.json +++ b/state/memory.json @@ -63,7 +63,7 @@ "Imagination's live shader realizes the six-petal topology as three mirrored sheet-pair fields. Keep film, rim, tendril, spark, shadow, and seed distances separated through material classification so raised rims can glow without collapsing the petal sheets into one generic blob.", "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 radiant warm command sphere crossed by a compact log-spherical lattice. Rails are shell-band/angular-band level-set crossings, gates are multi-band crossings, and core inlays/veins come from the same field language. Do not rebuild Self as named hoop inventories, one-radius ornament layers, or repeated trigonometry piles.", + "Self's body is the routing authority object: a radiant warm command sphere crossed by a compact log-spherical lattice. Rails are fixed radial shell strata crossed with angular harmonic bands, gates are multi-band crossings, and each concentric shell owns an orthogonal frame. Do not animate radial zero crossings, grow rings from points, or rebuild Self as named hoop inventories, one-radius ornament layers, or repeated trigonometry piles.", "For Self, the orrery comparison is motion and topology grammar. Rails, gates, and seams should emerge from a shared orbital space with phase motion, not from independent tilted hoops, loose symbols, or literal anatomical motifs.", "Self is allowed to be a scene light, but its visible body must not add full primitive light radiance to every surface. Scale field-owned radiance to small accents and let PBR material contrast carry the core, rails, gates, and seam.", "Heavy/specialized SDF evaluators should not live inside generic packed-id helpers when those helpers are called repeatedly; avoid shader compiler path cloning.",