mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-25 03:40:40 +00:00
Use TimeOfDayInterpolator for Land Fog Depth
Fixes the sudden fog jump at nightfall.
This commit is contained in:
parent
45bf3e6788
commit
802620a86b
@ -122,8 +122,10 @@ Weather::Weather(const std::string& name,
|
|||||||
fallback.getFallbackColour("Weather_" + name + "_Sun_Day_Color"),
|
fallback.getFallbackColour("Weather_" + name + "_Sun_Day_Color"),
|
||||||
fallback.getFallbackColour("Weather_" + name + "_Sun_Sunset_Color"),
|
fallback.getFallbackColour("Weather_" + name + "_Sun_Sunset_Color"),
|
||||||
fallback.getFallbackColour("Weather_" + name + "_Sun_Night_Color"))
|
fallback.getFallbackColour("Weather_" + name + "_Sun_Night_Color"))
|
||||||
, mLandFogDayDepth(fallback.getFallbackFloat("Weather_" + name + "_Land_Fog_Day_Depth"))
|
, mLandFogDepth(fallback.getFallbackFloat("Weather_" + name + "_Land_Fog_Day_Depth"),
|
||||||
, mLandFogNightDepth(fallback.getFallbackFloat("Weather_" + name + "_Land_Fog_Night_Depth"))
|
fallback.getFallbackFloat("Weather_" + name + "_Land_Fog_Day_Depth"),
|
||||||
|
fallback.getFallbackFloat("Weather_" + name + "_Land_Fog_Day_Depth"),
|
||||||
|
fallback.getFallbackFloat("Weather_" + name + "_Land_Fog_Night_Depth"))
|
||||||
, mSunDiscSunsetColor(fallback.getFallbackColour("Weather_" + name + "_Sun_Disc_Sunset_Color"))
|
, mSunDiscSunsetColor(fallback.getFallbackColour("Weather_" + name + "_Sun_Disc_Sunset_Color"))
|
||||||
, mWindSpeed(fallback.getFallbackFloat("Weather_" + name + "_Wind_Speed"))
|
, mWindSpeed(fallback.getFallbackFloat("Weather_" + name + "_Wind_Speed"))
|
||||||
, mCloudSpeed(fallback.getFallbackFloat("Weather_" + name + "_Cloud_Speed"))
|
, mCloudSpeed(fallback.getFallbackFloat("Weather_" + name + "_Cloud_Speed"))
|
||||||
@ -1043,8 +1045,7 @@ inline void WeatherManager::calculateResult(const int weatherID, const float gam
|
|||||||
|
|
||||||
mResult.mNight = (gameHour < mSunriseTime || gameHour > mTimeSettings.mNightStart - 1);
|
mResult.mNight = (gameHour < mSunriseTime || gameHour > mTimeSettings.mNightStart - 1);
|
||||||
|
|
||||||
mResult.mFogDepth = mResult.mNight ? current.mLandFogNightDepth : current.mLandFogDayDepth;
|
mResult.mFogDepth = current.mLandFogDepth.getValue(gameHour, mTimeSettings);
|
||||||
|
|
||||||
mResult.mFogColor = current.mFogColor.getValue(gameHour, mTimeSettings);
|
mResult.mFogColor = current.mFogColor.getValue(gameHour, mTimeSettings);
|
||||||
mResult.mAmbientColor = current.mAmbientColor.getValue(gameHour, mTimeSettings);
|
mResult.mAmbientColor = current.mAmbientColor.getValue(gameHour, mTimeSettings);
|
||||||
mResult.mSunColor = current.mSunColor.getValue(gameHour, mTimeSettings);
|
mResult.mSunColor = current.mSunColor.getValue(gameHour, mTimeSettings);
|
||||||
|
@ -84,8 +84,7 @@ namespace MWWorld
|
|||||||
TimeOfDayInterpolator<osg::Vec4f> mSunColor;
|
TimeOfDayInterpolator<osg::Vec4f> mSunColor;
|
||||||
|
|
||||||
// Fog depth/density
|
// Fog depth/density
|
||||||
float mLandFogDayDepth;
|
TimeOfDayInterpolator<float> mLandFogDepth;
|
||||||
float mLandFogNightDepth;
|
|
||||||
|
|
||||||
// Color modulation for the sun itself during sunset
|
// Color modulation for the sun itself during sunset
|
||||||
osg::Vec4f mSunDiscSunsetColor;
|
osg::Vec4f mSunDiscSunsetColor;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user