diff --git a/resources/lang/en.json b/resources/lang/en.json index 5dfce1e70..92fcb3a16 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -523,6 +523,8 @@ "colored_names_label": "Name color", "coordinate_grid_opacity_desc": "How opaque the coordinate grid is (lower lets more things show through)", "coordinate_grid_opacity_label": "Coordinate grid opacity", + "fallout_desc": "Show the green nuclear fallout glow on irradiated territory. Disable to improve performance", + "fallout_label": "Fallout effects", "highlight_brighten_desc": "How strongly the border brightens on hover (0 to disable)", "highlight_brighten_label": "Border highlight amount", "highlight_fill_desc": "How strongly territory brightens on hover (0 to disable)", diff --git a/src/client/hud/layers/GraphicsSettingsModal.ts b/src/client/hud/layers/GraphicsSettingsModal.ts index 22ca56b20..d0b65abac 100644 --- a/src/client/hud/layers/GraphicsSettingsModal.ts +++ b/src/client/hud/layers/GraphicsSettingsModal.ts @@ -487,6 +487,17 @@ export class GraphicsSettingsModal extends LitElement implements Controller { this.patchPassEnabled({ fx: !this.currentSpecialEffects() }); } + private currentFallout(): boolean { + return ( + this.userSettings.graphicsOverrides().passEnabled?.fallout ?? + renderDefaults.passEnabled.falloutBloom + ); + } + + private onToggleFallout() { + this.patchPassEnabled({ fallout: !this.currentFallout() }); + } + /** Whether colorblind mode is currently enabled. */ private currentColorblind(): boolean { return ( @@ -1137,6 +1148,25 @@ export class GraphicsSettingsModal extends LitElement implements Controller { + +
diff --git a/src/client/render/gl/GraphicsOverrides.ts b/src/client/render/gl/GraphicsOverrides.ts index 453e371c5..021450c6a 100644 --- a/src/client/render/gl/GraphicsOverrides.ts +++ b/src/client/render/gl/GraphicsOverrides.ts @@ -38,6 +38,9 @@ export const GraphicsOverridesSchema = z passEnabled: z .object({ fx: z.boolean(), + // Nuclear fallout effects: the broiling green territory bloom and its + // light emission in day/night mode. Disable to improve performance. + fallout: z.boolean(), }) .partial(), accessibility: z diff --git a/src/client/render/gl/RenderOverrides.ts b/src/client/render/gl/RenderOverrides.ts index cd71ea9ed..5d53883e5 100644 --- a/src/client/render/gl/RenderOverrides.ts +++ b/src/client/render/gl/RenderOverrides.ts @@ -73,6 +73,12 @@ export function applyGraphicsOverrides( if (overrides.passEnabled?.fx !== undefined) { settings.passEnabled.fx = overrides.passEnabled.fx; } + if (overrides.passEnabled?.fallout !== undefined) { + // One user-facing toggle drives both fallout passes: the territory bloom + // and its additive light contribution in the day/night composite. + settings.passEnabled.falloutBloom = overrides.passEnabled.fallout; + settings.passEnabled.falloutLight = overrides.passEnabled.fallout; + } if (overrides.terrain?.oceanColor !== undefined) { settings.terrain.oceanColor = overrides.terrain.oceanColor; } diff --git a/src/client/render/gl/RenderSettings.ts b/src/client/render/gl/RenderSettings.ts index 6654e50a4..d301f1e2d 100644 --- a/src/client/render/gl/RenderSettings.ts +++ b/src/client/render/gl/RenderSettings.ts @@ -52,6 +52,7 @@ export interface RenderSettings { unit: boolean; name: boolean; falloutBloom: boolean; + falloutLight: boolean; railroad: boolean; fx: boolean; bar: boolean; diff --git a/src/client/render/gl/passes/LightmapPass.ts b/src/client/render/gl/passes/LightmapPass.ts index 5994b1fc3..935fc958c 100644 --- a/src/client/render/gl/passes/LightmapPass.ts +++ b/src/client/render/gl/passes/LightmapPass.ts @@ -160,7 +160,9 @@ export class LightmapPass { this.pointLightPass.draw(cameraMatrix); // --- 2. Fallout light → extract at tile res, composite into FBO A (additive) --- - this.falloutLightPass.draw(cameraMatrix, this.lightFboA, lw, lh, tick); + if (this.settings.passEnabled.falloutLight) { + this.falloutLightPass.draw(cameraMatrix, this.lightFboA, lw, lh, tick); + } // --- 3. Blur: 2 iterations separable H+V Gaussian --- const zoom = Math.abs(cameraMatrix[0]); diff --git a/src/client/render/gl/render-settings.json b/src/client/render/gl/render-settings.json index b2d3487c7..4c3e0eb39 100644 --- a/src/client/render/gl/render-settings.json +++ b/src/client/render/gl/render-settings.json @@ -10,6 +10,7 @@ "unit": true, "name": true, "falloutBloom": true, + "falloutLight": true, "railroad": true, "fx": true, "bar": true,