From aac2bdf2e6bb123f5a4b9653d0888be4570485ad Mon Sep 17 00:00:00 2001 From: dangrubbb Date: Sat, 24 Oct 2026 09:32:17 -0400 Subject: [PATCH] =?UTF-8?q?radiance:=20snow-globe=20containment=20?= =?UTF-8?q?=E2=80=94=20tangential=20cursor=20push,=20glass=20wall,=20radiu?= =?UTF-8?q?s=20cap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/scripts/orb.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/scripts/orb.js b/src/scripts/orb.js index 7725771..cc4d029 100644 --- a/src/scripts/orb.js +++ b/src/scripts/orb.js @@ -382,7 +382,11 @@ void main() { vec3 push = viewToBody(vec3(flow, 0.0)) * uGain * front; // hard stirring also tumbles particles through depth, so the volume churns instead of sliding sideways vec3 tumble = curlNoise(pos * 4.0 + vec3(0.0, 0.0, t * 0.9)) * fm * 0.7 * front; - vec3 depth = n * (h01(idx * 8u + 7u) - 0.5) * fm * 0.9 * front; + vec3 depth = n * (h01(idx * 8u + 7u) - 0.5) * fm * 0.9 * front * (1.0 - surf); + // snow globe: a push is felt along the glass, not through it. Near the limb that slides the particle + // around to the far side instead of out of the ball. + push -= n * dot(push, n); + tumble -= n * dot(tumble, n) * 0.7; // idle: slow broad currents plus finer eddies, kept mostly along the skin so streaks pile up and shear vec3 amb = curlNoise(pos * 1.35 + vec3(0.0, 0.0, t * 0.35)) @@ -394,11 +398,12 @@ void main() { vel += (target - vel) * (1.0 - exp(-uDt * 3.0)); pos += vel * uDt; - // soft restoring pull to its layer + // the glass wall: no outward velocity at the shell, a hard radius cap, and a soft pull back to its layer r = length(pos); n = pos / max(r, 1e-4); + vel -= n * max(dot(vel, n), 0.0) * smoothstep(rt - 0.05, rt + 0.01, r); r = mix(r, rt, 1.0 - exp(-uDt * 1.6)); - pos = n * r; + pos = n * min(r, 0.985); stir = max(stir * exp(-uDt * 1.2), clamp(fm * front * 1.5, 0.0, 1.5)); oPos = vec4(pos, stir);