diff --git a/src/Aquarium.Engine/Render/Shaders/D3D12BodyProxy.hlsli b/src/Aquarium.Engine/Render/Shaders/D3D12BodyProxy.hlsli index 79fd790..c465830 100644 --- a/src/Aquarium.Engine/Render/Shaders/D3D12BodyProxy.hlsli +++ b/src/Aquarium.Engine/Render/Shaders/D3D12BodyProxy.hlsli @@ -1,5 +1,5 @@ #ifndef BODY_TRACE_STEPS -#define BODY_TRACE_STEPS 128 +#define BODY_TRACE_STEPS 384 #endif #ifndef BODY_TRACE_STEP_SCALE @@ -85,13 +85,13 @@ bool traceBody(float3 origin, float3 direction, int agentIndex, out float travel float3 p = origin + direction * travel; surface = bodySurface(p, agentIndex); stepCount = (float)(stepIndex + 1); - if (previousDistance > 0.0 && surface.distanceValue <= 0.0) + if (surface.distanceValue <= 0.0) { - return refineBodyHit(origin, direction, agentIndex, previousTravel, travel, travel, normal, surface); - } + if (previousDistance > 0.0) + { + return refineBodyHit(origin, direction, agentIndex, previousTravel, travel, travel, normal, surface); + } - if (abs(surface.distanceValue) < max(BODY_TRACE_MIN_STEP, travel * 0.00018)) - { normal = bodyNormal(p, agentIndex); return true; } diff --git a/state/evidence.jsonl b/state/evidence.jsonl index 89f0eee..6b0e98f 100644 --- a/state/evidence.jsonl +++ b/state/evidence.jsonl @@ -36,3 +36,4 @@ {"timestamp":"2026-05-11T23:23:04+01:00","topic":"cursor-hibiscus-anatomy","lesson":"The cursor hibiscus needs recognizable flower anatomy, not just three glossy petals. The cursor SDF now includes curled ruffled petals, a throat, a protruding staminal column with pollen beads, and a green calyx/contact stem, with a larger proxy bound to prevent clipping the expanded silhouette.","files":["src/Aquarium.Engine/Render/Shaders/D3D12SdfMath.hlsli","src/Aquarium.Engine/Render/Shaders/D3D12CursorBody.hlsl","src/Aquarium.Engine/Render/D3D12Renderer.cs"],"source":"visual reference comparison"} {"timestamp":"2026-05-11T23:35:00+01:00","topic":"thin-structure-body-marching","lesson":"All role bodies are expected to carry thin visible structure, so conservative body SDF tracing is the shared default rather than a cursor-specific exception. Body proxy tracing now uses tighter hit epsilon, more steps, and smaller step scale through shared macros; faster tracing should only reappear through explicit LOD policy after it proves it preserves filaments, ribs, rings, petals, and other narrow organs.","files":["src/Aquarium.Engine/Render/Shaders/D3D12BodyProxy.hlsli","src/Aquarium.Engine/Render/Shaders/D3D12CursorBody.hlsl","src/Aquarium.Engine/Render/Shaders/D3D12SdfMath.hlsli","state/memory.json"],"source":"user visual artifact review"} {"timestamp":"2026-05-11T23:39:00+01:00","topic":"sheet-sdf-petals-and-guarded-marching","lesson":"Do not represent petals and other thin organs as fat ellipsoids with decorative displacement. The recursive lotus reference preserves delicate structure by using slab/intersection fields and scaling the distance estimate after its log-spherical mapping; Aquarium cursor petals now use thin clipped sheet SDFs, and the shared body marcher caps step length plus refines positive-to-negative sign crossings instead of trusting pseudo-distance composites blindly.","files":["src/Aquarium.Engine/Render/Shaders/D3D12BodyProxy.hlsli","src/Aquarium.Engine/Render/Shaders/D3D12SdfMath.hlsli","state/memory.json"],"source":"https://github.com/pac-dev/notes/blob/master/content/logspherical/recursive_lotus.glsl"} +{"timestamp":"2026-05-11T23:47:00+01:00","topic":"pseudo-distance-near-miss-hits","lesson":"The cursor stamen and angled petals disappeared because the body proxy marcher accepted abs(distance) < epsilon as a hit on a pseudo-distance composite. Rays that passed near a petal sheet could terminate before reaching the actual stamen or petal intersection. The proxy marcher now requires distance <= 0 entry, refines positive-to-negative brackets, and uses a larger step budget to survive capped steps across the proxy volume.","files":["src/Aquarium.Engine/Render/Shaders/D3D12BodyProxy.hlsli","state/memory.json"],"source":"user visual artifact review"} diff --git a/state/memory.json b/state/memory.json index 8aa2d95..c20acff 100644 --- a/state/memory.json +++ b/state/memory.json @@ -42,6 +42,7 @@ "Chained smooth-union role organs need conservative tracing even when each primitive has a decent distance estimate. Keep petal overlaps substantial, union radii generous, hit epsilon tight, and step scale small enough that narrow joins are sampled instead of skipped.", "All role bodies should be expected to contain thin structure. The shared body proxy marcher must default to conservative tracing that preserves stamens, petals, ribs, rings, filaments, and other narrow organs; faster tracing belongs behind explicit LOD policy, not private one-off body overrides.", "Thin petal-like organs should be modeled as sheet/slab fields with explicit footprint bounds, not fat ellipsoids with decorative warps. If a transform or warp changes local metric, either scale the returned distance estimate conservatively like log-spherical SDF examples do, or cap the marcher step and refine sign crossings.", + "For pseudo-distance body composites, do not accept abs(distance) below epsilon as a surface hit. A ray that merely passes near a petal sheet can terminate before the real front intersection behind it. Body proxy tracing should enter solids by distance <= 0 and refine the positive-to-negative bracket.", "Imagination should read as distinct petals first, not as a fully merged blob. Keep the central seed small, make petal lobes narrow and visibly separated, and accept intentional negative space when it makes the role shape legible.", "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.",