From 5161d78d8466b326119bced07017ad50e13a997b Mon Sep 17 00:00:00 2001 From: evanpelle Date: Sun, 14 Jun 2026 18:45:29 -0700 Subject: [PATCH] =?UTF-8?q?Fix=20nuke=20fallout=20embers=20flickering=20fo?= =?UTF-8?q?rever=20=E2=98=A2=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ember/particle flicker in the fallout effect was gated only by the fallout bit, which is permanent on tiles that stay unowned. It also ramped to full strength as the per-tile heat decayed to 0 and animated on the global tick, so it kept flickering indefinitely after the blast had cooled — visible both as the bloom dots and (more prominently) as the ambient ember light when dynamic lighting is enabled. Fade both with heat so they vanish along with the glow: - extract.frag.glsl: bloom dots multiplied by the glow's opacity - fallout-light.frag.glsl: ember light multiplied by heat Heat decay timing is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../render/gl/shaders/day-night/fallout-light.frag.glsl | 4 ++++ src/client/render/gl/shaders/fallout-bloom/extract.frag.glsl | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/client/render/gl/shaders/day-night/fallout-light.frag.glsl b/src/client/render/gl/shaders/day-night/fallout-light.frag.glsl index 1744140bf..0c34d8999 100644 --- a/src/client/render/gl/shaders/day-night/fallout-light.frag.glsl +++ b/src/client/render/gl/shaders/day-night/fallout-light.frag.glsl @@ -45,6 +45,10 @@ void main() { float flick = max(0.0, sin(uTick * tileRate + h1 * 12.0) * 0.8 + 0.2); flick *= flick; flick *= mix(uParticleFreshScale, 1.0, 1.0 - heat); + // Fade embers out with the heat. The fallout bit is permanent on tiles + // that stay unowned, so without this the ember light flickers forever + // once the blast has cooled. + flick *= heat; light += uEmberLightColor * flick * uEmberLightIntensity; } diff --git a/src/client/render/gl/shaders/fallout-bloom/extract.frag.glsl b/src/client/render/gl/shaders/fallout-bloom/extract.frag.glsl index 26bafa472..c9bcf1f6d 100644 --- a/src/client/render/gl/shaders/fallout-bloom/extract.frag.glsl +++ b/src/client/render/gl/shaders/fallout-bloom/extract.frag.glsl @@ -102,6 +102,10 @@ void main() { flick *= flick; // Dampen when fresh (high heat); ramp to full as heat decays. flick *= mix(uParticleFreshScale, 1.0, 1.0 - heat); + // Fade dots out with the glow. Heat decays to 0, but the fallout bit is + // permanent on tiles that stay unowned, so without this the dots flicker + // forever once the bloom is gone. + flick *= opacity; vec3 pc = mix(uParticleColorDark, uParticleColorBright, h1) * flick * uParticleStrength; float pa = max(pc.r, max(pc.g, pc.b)); fragColor += vec4(pc, pa);