From 3ead818d35df56e6efbe3397967befba8d4bdb5d Mon Sep 17 00:00:00 2001 From: skal Date: Tue, 10 Mar 2026 23:04:13 +0100 Subject: fix(effects): particle sync and heptagon SDF bugs - particles: stagger respawn y by golden-ratio index offset to break per-row synchronization (100 particles per row fell in lock-step) - heptagon: fix swapped atan2(x,y)->atan2(y,x) and WGSL % truncation for negative angles (broke SDF for entire lower half of shape) handoff(Gemini): heptagon now correct; particles desynchronized Co-Authored-By: Claude Sonnet 4.6 --- src/effects/particle_compute.wgsl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/effects') diff --git a/src/effects/particle_compute.wgsl b/src/effects/particle_compute.wgsl index 2960cc4..f3e8051 100644 --- a/src/effects/particle_compute.wgsl +++ b/src/effects/particle_compute.wgsl @@ -23,7 +23,8 @@ fn main(@builtin(global_invocation_id) id: vec3u) { p.vel.y = p.vel.y - 0.01 * (1.0 + uniforms.audio_intensity * 5.0); p.rot.x = p.rot.x + p.rot.y * 0.016; if (p.pos.y < -1.5) { - p.pos.y = 1.5; + // Stagger respawn height by index (golden ratio) to break synchronization + p.pos.y = 1.5 + fract(f32(i) * 0.6180339) * 3.0; p.pos.x = (f32(i % 100u) / 50.0) - 1.0 + (uniforms.audio_intensity * 0.5); p.vel.y = 0.0; } -- cgit v1.2.3