From 2e98cad895f48c30c03382a98f09b1d88af19ba7 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Thu, 27 Sep 2018 17:34:46 +0300 Subject: [PATCH] Fade out sun glare and specularity completely at night start, not sunset start --- apps/openmw/mwworld/weather.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwworld/weather.cpp b/apps/openmw/mwworld/weather.cpp index ac885f429c..7d3f41894d 100644 --- a/apps/openmw/mwworld/weather.cpp +++ b/apps/openmw/mwworld/weather.cpp @@ -751,14 +751,14 @@ void WeatherManager::update(float duration, bool paused, const TimeStamp& time, float underwaterFog = mUnderwaterFog.getValue(time.getHour(), mTimeSettings, "Fog"); - float peakHour = mSunriseTime + (mSunsetTime - mSunriseTime) / 2; + float peakHour = mSunriseTime + (mTimeSettings.mNightStart - mSunriseTime) / 2; float glareFade = 1.f; - if (time.getHour() < mSunriseTime || time.getHour() > mSunsetTime) + if (time.getHour() < mSunriseTime || time.getHour() > mTimeSettings.mNightStart) glareFade = 0.f; else if (time.getHour() < peakHour) - glareFade -= (peakHour - time.getHour()) / (peakHour - mSunriseTime); + glareFade = 1.f - (peakHour - time.getHour()) / (peakHour - mSunriseTime); else - glareFade -= (time.getHour() - peakHour) / (mSunsetTime - peakHour); + glareFade = 1.f - (time.getHour() - peakHour) / (mTimeSettings.mNightStart - peakHour); mRendering.getSkyManager()->setGlareTimeOfDayFade(glareFade);