Restore Soul geometry and boost crystal light

This commit is contained in:
Meta Vens 2026-05-13 17:51:43 +01:00
commit 258ef7b5f0
2 changed files with 26 additions and 27 deletions

View file

@ -24,12 +24,8 @@ float soulMid3(float3 value)
float soulBodyDistance(float3 local, float confidence, float risk)
{
float scale = lerp(0.66, 0.74, confidence) - risk * 0.035;
float bevel = lerp(0.030, 0.014, confidence) + risk * 0.006;
float3 q = abs(local);
float octahedron = (dot(q, float3(1.0, 1.0, 1.0)) - scale) * 0.57735027;
float cap = lerp(0.46, 0.53, confidence) - risk * 0.018;
float truncation = soulMax3(q - cap);
return max(octahedron, truncation) - bevel;
float bevel = lerp(0.085, 0.040, confidence) + risk * 0.012;
return (dot(abs(local), float3(1.0, 1.0, 1.0)) - scale) * 0.57735027 - bevel;
}
SoulField soulField(float3 local, SdfObject sdfObject)
@ -41,19 +37,20 @@ SoulField soulField(float3 local, SdfObject sdfObject)
float3 riskNormal = normalize(float3(0.24, 0.86, 0.45));
float riskPlane = dot(local, riskNormal) + 0.018 * sin(timeSeconds * 0.51 + confidence * 2.0);
float riskWidth = lerp(0.010, 0.036, risk);
float riskSeam = abs(riskPlane) - riskWidth;
float riskWidth = lerp(0.018, 0.070, risk);
float riskSeam = length(float2(body * 1.35, riskPlane)) - riskWidth;
float edgeAgreement = min(abs(q.x - q.y), min(abs(q.y - q.z), abs(q.z - q.x)));
float edgeMask = smoothstep(0.02, 0.20, soulMax3(q) - soulMid3(q));
float findingWidth = lerp(0.010, 0.020, confidence) * edgeMask;
float findingEdge = edgeAgreement - findingWidth;
float findingWidth = lerp(0.007, 0.018, confidence) * edgeMask;
float findingEdge = length(float2(body * 1.45, edgeAgreement)) - findingWidth;
SoulField field;
field.body = body;
field.riskSeam = riskSeam;
field.findingEdge = findingEdge;
field.distanceValue = body;
field.distanceValue = smoothUnion(body, riskSeam, 0.010);
field.distanceValue = smoothUnion(field.distanceValue, findingEdge, 0.006);
return field;
}
@ -74,20 +71,20 @@ SdfSurface sdfSurface(float3 p, int sdfIndex)
float confidence = saturate(sdfObject.state.y);
float risk = saturate(sdfObject.state.z * 1.55 + (1.0 - confidence) * 0.35);
float isRisk = field.riskSeam <= 0.0 ? 1.0 : 0.0;
float isFinding = (1.0 - isRisk) * (field.findingEdge <= 0.0 ? 1.0 : 0.0);
float isRisk = field.riskSeam <= min(field.body, field.findingEdge) ? 1.0 : 0.0;
float isFinding = (1.0 - isRisk) * (field.findingEdge <= field.body ? 1.0 : 0.0);
float isFacet = (1.0 - isRisk) * (1.0 - isFinding);
float3 facetColor = lerp(float3(0.055, 0.070, 0.18), float3(0.26, 0.34, 0.72), confidence);
float3 findingColor = lerp(float3(0.08, 0.22, 0.58), float3(0.58, 0.82, 1.0), confidence);
float3 riskColor = lerp(float3(0.24, 0.015, 0.045), float3(0.86, 0.055, 0.06), risk);
float3 facetColor = lerp(float3(0.018, 0.024, 0.070), float3(0.16, 0.22, 0.56), confidence);
float3 findingColor = lerp(float3(0.10, 0.30, 0.78), float3(0.68, 0.90, 1.0), confidence);
float3 riskColor = lerp(float3(0.30, 0.020, 0.045), float3(0.95, 0.070, 0.055), risk);
SdfSurface surface;
surface.baseColor = facetColor * isFacet + findingColor * isFinding + riskColor * isRisk;
surface.metallic = 0.0;
surface.roughness = 0.055 * isFacet + 0.08 * isFinding + 0.12 * isRisk;
surface.emission = findingColor * isFinding * (0.20 + confidence * 0.50)
+ riskColor * isRisk * (0.06 + risk * 0.36);
surface.roughness = 0.040 * isFacet + 0.075 * isFinding + 0.12 * isRisk;
surface.emission = findingColor * isFinding * (0.34 + confidence * 0.62)
+ riskColor * isRisk * (0.14 + risk * 0.46);
return surface;
}
@ -106,17 +103,18 @@ float3 soulCrystalShade(float3 p, float3 normal, int sdfIndex, SdfSurface surfac
float refractionValid = dot(refracted, refracted) > 0.001 ? 1.0 : 0.0;
float3 glassDirection = normalize(lerp(reflected, refracted, refractionValid));
float3 glassTint = lerp(float3(0.30, 0.42, 0.82), float3(0.62, 0.76, 1.0), confidence);
float3 pseudoRefraction = studioPmremSample(glassDirection, 3.2) * glassTint * 0.32;
float3 pseudoRefraction = studioPmremSample(glassDirection, 2.2) * glassTint * 0.55;
float centerGlow = pow(ndv, 1.25) * saturate(1.38 - length(local) * 0.88);
float rimGlow = pow(1.0 - ndv, 3.0);
float facetFlash = pow(saturate(abs(normal.x) + abs(normal.y) + abs(normal.z) - 1.18), 2.0);
float centerGlow = pow(ndv, 0.72) * saturate(1.45 - length(local) * 0.84);
float rimGlow = pow(1.0 - ndv, 2.15);
float facetFlash = pow(saturate(abs(normal.x) + abs(normal.y) + abs(normal.z) - 1.05), 2.0);
float internalChamber = smoothstep(0.72, 0.18, length(local));
float pulse = 0.88 + 0.12 * sin(timeSeconds * 1.7 + confidence * 2.4);
float3 oathLight = float3(1.0, 0.94, 0.78) * pulse * (0.26 + confidence * 0.58) * (centerGlow + rimGlow * 0.34);
float3 edgeLight = float3(0.45, 0.68, 1.0) * (rimGlow * 0.36 + facetFlash * 0.18) * (0.6 + confidence * 0.5);
float3 riskFaultLight = float3(1.0, 0.10, 0.055) * risk * pow(rimGlow, 0.65) * 0.14;
float3 oathLight = float3(1.0, 0.94, 0.72) * pulse * (0.44 + confidence * 1.10) * (centerGlow * 0.55 + internalChamber + rimGlow * 0.32);
float3 edgeLight = float3(0.42, 0.70, 1.0) * (rimGlow * 0.72 + facetFlash * 0.42) * (0.7 + confidence * 0.7);
float3 riskFaultLight = float3(1.0, 0.10, 0.055) * risk * pow(rimGlow, 0.65) * 0.22;
return shadeSdfPbr(p, normal, surface) * 0.72
return shadeSdfPbr(p, normal, surface) * 0.46
+ pseudoRefraction
+ oathLight
+ edgeLight

View file

@ -83,3 +83,4 @@
{"timestamp":"2026-05-13T05:42:00+01:00","topic":"self-orthonormal-orbital-frame","lesson":"Self rail bands should not be oriented by three independently normalized phase vectors. That can make lattice axes collapse into a shared plane, causing bands to stack before diverging again. Build each shell frame as a real orthonormal basis from a precessing pole, projected tangent seed, cross-product tangent, and spin around the pole so all three axes keep participating.","files":["src/Aquarium.Epiphany/Shaders/D3D12SelfBody.hlsl","state/memory.json","state/evidence.jsonl"],"source":"user screenshot showed Self bands temporarily stacking along one plane"}
{"timestamp":"2026-05-13T06:02:00+01:00","topic":"agent-organ-spec-domain-elaboration","lesson":"Role body specs should name each organ's governing spatial domain before listing features. Face uses mouth-flow aperture coordinates; Eyes uses lens-hemisphere/tangent-disk evidence directions; Body uses superellipsoid surface stress paths; Hands uses prolate tool coordinates around workDirection; Soul uses constraint-plane half-spaces; Life uses a cardioid shell plus logarithmic spiral continuity grammar. This keeps future implementations from falling back to vague primitives and decorative attachments.","files":["docs/epiphany-agent-sdf-visual-language.md","state/evidence.jsonl"],"source":"user requested elaboration pass after Self and Imagination raised the visual standard"}
{"timestamp":"2026-05-13T17:40:00+01:00","topic":"soul-crystal-local-shading","lesson":"Soul's first real shader uses constraint-plane/octahedral domain math for the verdict crystal and keeps crystal refraction/inner oath light as Soul-local shading: PMREM-based pseudo-refraction, facet/risk/finding material regions, and an inner glow. Do not expand the shared SdfSurface material packet for transmission until the renderer owns an actual scene-refraction or thickness contract; fake generic material fields are just costumes for missing architecture.","files":["src/Aquarium.Epiphany/Shaders/D3D12SoulAgent.hlsl","state/evidence.jsonl"],"source":"Soul implementation pass"}
{"timestamp":"2026-05-13T17:52:00+01:00","topic":"soul-geometry-before-material-tuning","lesson":"When Soul's octahedral constraint-plane geometry reads better than a later material experiment, restore the geometry instead of preserving churn. Make risk and finding features serve the crystal silhouette, then push crystal feel with stronger local caustic/rim/inner-light shading; if it still cannot read refractive, the next coherent step is a real renderer transmission/scene-sampling contract, not more ad hoc shared material flags.","files":["src/Aquarium.Epiphany/Shaders/D3D12SoulAgent.hlsl","state/evidence.jsonl"],"source":"user visual correction after Soul crystal material pass"}