Fix vehicle corona/shadow flicker on fogless to foggy weather blend#4901
Merged
FileEX merged 2 commits intomultitheftauto:masterfrom May 7, 2026
Merged
Conversation
…ultitheftauto#4803) ResyncInterpolationWithGameClock snapped CWeather::InterpolationValue to minute/60, dropping the seconds component. CTimeCycle::CalcColoursForPoint then blended m_CurrentColours per game-minute instead of per frame, so m_fSpriteBrightness (vehicle coronas) and m_wShadowStrength (vehicle shadows) ticked visibly when the game clock runs fast. Match the value CWeather::Update derives at 0x72B897 (seconds/3600 + minutes/60) so the wrap-suppression still holds and m_CurrentColours interpolates smoothly each frame.
FileEX
approved these changes
May 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Include
CClock::ms_nGameClockSecondsinCWeatherSA::ResyncInterpolationWithGameClocksoCWeather::InterpolationValuematches the valueCWeather::Updatederives (seconds/3600 + minutes/60).Motivation
Follow-up to #4882. Residual flicker on vehicle coronas and shadows during fogless to foggy weather blends (e.g.
SUNNY_COUNTRYSIDEtoFOGGY_SFreported by rx).The previous resync snapped
InterpolationValuetominute/60only.CTimeCycle::CalcColoursForPointthen blendedm_CurrentColoursbetween the weather pair using that snapped value, so:m_CurrentColours.m_fSpriteBrightness(read byCEntity::ProcessLightsForEntityat0x6FCF83for vehicle corona intensity)m_CurrentColours.m_wShadowStrength(read byCShadows::StoreShadowForVehicleat0x70BDB9for vehicle shadow intensity)both updated in per-game-minute steps. With fast game clocks one game-minute is a fraction of a real second, so the steps surfaced as visible flicker on cars.
CWeather::Foggynessitself was already smooth (it usesv0), which is why building lights and most other weather-driven values were fixed by #4882.Adding seconds keeps the wrap-suppression intact (
v0 >= InterpolationValuestill holds, equal) and letsm_CurrentColoursinterpolate smoothly each frame.Test plan
setWeatherBlendedfrom a fogless weather (e.g.14SUNNY_COUNTRYSIDE) to a foggy one (e.g.9FOGGY_SF).Checklist