mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-08 01:30:39 +00:00
update webgl nuke effects (#3984)
## Description: Reworks the visual look of nuked tiles to read uniformly green (no more brown/black bleed-through), and moves the ember "particle" effect out of the border passes — where it lived as a storage-sharing hack — into the fallout system where it belongs. ## What changed visually - **Fresh fallout**: bright uniform bloom with a hint of flickering green particles dampened on fresh tiles, ramping up as heat decays (`particleFreshScale` controls the fresh-tile dampening). - **Stale fallout**: dark-green ground (was near-black charcoal), with full-strength flickering particles in dark-green ↔ light-green. - **Particles**: per-tile flicker is now de-synced (each tile pulses at its own rate, 0.4×–1.6× base speed) so the eye can't lock onto a global rhythm. - **No more brown/black pixels** in fallout zones. Two root causes were fixed: - The territory pass now renders stale-nuke ground for **all** fallout tiles, not just unowned ones — so an owned player's color can't show through where the bloom is dim/transparent. - The ember stamp (which fully replaced tile color with orange) is gone; particle render is now additive and color-tuned green. ## Architecture cleanup The ember effect was conceptually fallout-domain, but lived in `BorderComputePass` (writing intensity into `borderTex.g`) and `BorderStampPass` (stamping orange dots), just because the border pass already had an RGBA8 texture with a free G channel. Two consumers read from it (`BorderStampPass`, `FalloutLightPass`), and the per-tile flicker math used no border data at all. This PR relocates the math inline into the two passes that actually need it (`FalloutBloomPass.extract.frag.glsl` and `FalloutLightPass.fallout-light.frag.glsl`), drops the ember code from both border passes, and renames `mapOverlay.ember*` → `falloutBloom.particle*` so the settings live with their pass. Side benefits: - **Animation correctness**: the old setup only updated ember intensity when `BorderComputePass`'s dirty flag flipped (highlight change, relations update, etc.), so the supposed flicker was actually a frozen snapshot between border events. The new inline path runs every frame as intended. - **Slightly cheaper per-frame compute**: removed a per-dirty-event full-map writeback to `borderTex.g`; added a few cheap ALU ops (1 sin + 2 hashes) per fallout tile in shaders that were already running. Same texture memory. ## Other small changes - Renamed `mapOverlay.charcoal*` → `mapOverlay.staleNuke*` (charcoal was a misnomer now that the ground is green). - Added `staleNukeR/G/B` for the ground color (was hardcoded grey). - `intensityHot` bumped 0.6 → 1.8 for a brighter fresh-nuke glow. - Raised `railroad.railMinZoom` 2 → 4 and `railDetailZoom` 4 → 6 so rails pop in later (separate small commit). <img width="354" height="371" alt="Screenshot 2026-05-22 at 10 37 34 AM" src="https://github.com/user-attachments/assets/03b46c45-c617-41b3-b3e4-9934f064bfe1" /> <img width="335" height="358" alt="Screenshot 2026-05-22 at 10 37 43 AM" src="https://github.com/user-attachments/assets/af370b19-8f22-4694-9859-1ad52aa755a7" /> <img width="651" height="613" alt="Screenshot 2026-05-22 at 10 38 09 AM" src="https://github.com/user-attachments/assets/e06e5101-8529-49f6-b29a-ce0563eb52d6" /> ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: evan
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
"contrastHiHot": 0,
|
||||
"metaFreq": 0.02,
|
||||
"intensityCold": 0.15,
|
||||
"intensityHot": 0.6,
|
||||
"intensityHot": 1.8,
|
||||
"metaInfluenceCold": 1,
|
||||
"metaInfluenceHot": 0,
|
||||
"opacityFadeEnd": 1,
|
||||
@@ -31,7 +31,18 @@
|
||||
"bloomG": 0.8196078431372549,
|
||||
"bloomB": 0,
|
||||
"bloomCoverage": 1.1,
|
||||
"heatDecayPerTick": 1
|
||||
"heatDecayPerTick": 1,
|
||||
"particleColorDarkR": 0.05,
|
||||
"particleColorDarkG": 0.4,
|
||||
"particleColorDarkB": 0.05,
|
||||
"particleColorBrightR": 0.2,
|
||||
"particleColorBrightG": 1,
|
||||
"particleColorBrightB": 0.2,
|
||||
"particleThresholdUnowned": 0.85,
|
||||
"particleThresholdOwned": 0.875,
|
||||
"particleFlickerSpeed": 0.2,
|
||||
"particleStrength": 1,
|
||||
"particleFreshScale": 0.2
|
||||
},
|
||||
"dayNight": {
|
||||
"mode": "light",
|
||||
@@ -53,19 +64,12 @@
|
||||
"mapOverlay": {
|
||||
"trailAlpha": 0.588,
|
||||
"defenseCheckerDarken": 0.7,
|
||||
"charcoalBase": 0,
|
||||
"charcoalVariation": 0.05,
|
||||
"charcoalAlpha": 0.87,
|
||||
"emberThresholdUnowned": 0.85,
|
||||
"emberThresholdOwned": 0.875,
|
||||
"emberFlickerSpeed": 0.12,
|
||||
"emberColorDarkR": 0.6,
|
||||
"emberColorDarkG": 0.15,
|
||||
"emberColorDarkB": 0,
|
||||
"emberColorBrightR": 1,
|
||||
"emberColorBrightG": 0.5,
|
||||
"emberColorBrightB": 0.05,
|
||||
"emberStrengthUnowned": 0.5,
|
||||
"staleNukeBase": 0,
|
||||
"staleNukeVariation": 0.05,
|
||||
"staleNukeAlpha": 1,
|
||||
"staleNukeR": 0.05,
|
||||
"staleNukeG": 0.55,
|
||||
"staleNukeB": 0.07,
|
||||
"highlightBrighten": 0.25,
|
||||
"highlightFillBrighten": 0.15,
|
||||
"highlightThicken": 2,
|
||||
|
||||
Reference in New Issue
Block a user