radiance: 20% fewer particles drawn 20% bigger; stronger cursor reaction inside the orb; idle spin and currents +50%

This commit is contained in:
dangrubbb
2026-10-24 09:43:29 -04:00
parent cfd081abcd
commit ea3f061211

View File

@ -130,8 +130,8 @@ vec3 homeOf(uint idx, float epoch) {
float tSpawn = (epoch - h01(idx * 8u + 2u)) * lifeLen(idx);
return spawnDir(idx, epoch, tSpawn) * layerR(idx);
}
vec3 bodyToView(vec3 p) { return rotX(rotY(p, uTime * 0.045 + 2.4 + uTilt.x), uTilt.y); }
vec3 viewToBody(vec3 v) { return rotY(rotX(v, -uTilt.y), -(uTime * 0.045 + 2.4 + uTilt.x)); }
vec3 bodyToView(vec3 p) { return rotX(rotY(p, uTime * 0.0675 + 2.4 + uTilt.x), uTilt.y); }
vec3 viewToBody(vec3 v) { return rotY(rotX(v, -uTilt.y), -(uTime * 0.0675 + 2.4 + uTilt.x)); }
// ---- corona: sparks born on the rim, laid out in screen space, that drift outward and fizzle out.
// Each is reborn at a fresh spot on the rim (favouring tufts over the top) when its life ends.
@ -395,23 +395,23 @@ void main() {
vec2 flow = flowAt(bp.xy / (1.0 - bp.z * 0.12));
float fm = length(flow);
float front = mix(0.35, 1.0, smoothstep(-0.5, 0.5, bp.z));
vec3 push = viewToBody(vec3(flow, 0.0)) * uGain * front;
vec3 push = viewToBody(vec3(flow, 0.0)) * uGain * 1.7 * 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 * (1.0 - surf);
vec3 tumble = curlNoise(pos * 4.0 + vec3(0.0, 0.0, t * 0.9)) * fm * 1.1 * front;
vec3 depth = n * (h01(idx * 8u + 7u) - 0.5) * fm * 1.4 * 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))
+ 0.6 * curlNoise(pos * 3.2 + vec3(t * 0.15, 0.0, t * 0.7));
vec3 amb = curlNoise(pos * 1.35 + vec3(0.0, 0.0, t * 0.525))
+ 0.6 * curlNoise(pos * 3.2 + vec3(t * 0.225, 0.0, t * 1.05));
amb -= n * dot(amb, n) * mix(0.35, 0.8, surf);
amb *= 0.3 * uAmb;
amb *= 0.45 * uAmb;
vec3 target = amb + push + tumble + depth + (home - pos) * 0.3;
vel += (target - vel) * (1.0 - exp(-uDt * 3.0));
vel += (target - vel) * (1.0 - exp(-uDt * 4.5));
pos += vel * uDt;
// the glass wall: no outward velocity at the shell, a hard radius cap, and a soft pull back to its layer
@ -507,7 +507,7 @@ void main() {
gl_Position = vec4(px.x / uView.x * 2.0 - 1.0, 1.0 - px.y / uView.y * 2.0, 0.0, 1.0);
// glowing points are drawn larger so the halo has room around the core
float glowScale = 1.0 + vGlow * 2.4;
gl_PointSize = size * sc * uDpr * persp * glowScale;
gl_PointSize = size * 1.2 * sc * uDpr * persp * glowScale;
vCore = 1.0 / glowScale;
vColor = col;
}
@ -716,9 +716,9 @@ export function startOrb(canvas, { onReady } = {}) {
const coarse = matchMedia('(pointer: coarse)').matches;
const small = Math.min(innerWidth, innerHeight) < 600;
const T = small ? 192 : 320;
const INNER = small ? 26000 : 82000;
const CORONA = small ? 8000 : 18000;
const T = small ? 168 : 288;
const INNER = small ? 20800 : 65600;
const CORONA = small ? 6400 : 14400;
const TOTAL = INNER + CORONA;
let progs;