mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 21:23:52 +00:00
Atmosphere no longer does "real" alpha blending to blend with the horizon, this is in preparation for proper underwater viewport BG / fog
This commit is contained in:
parent
b1fc68d44d
commit
8aff033a0c
4 changed files with 11 additions and 2 deletions
|
@ -255,6 +255,7 @@ void SkyManager::create()
|
|||
sh::Factory::getInstance().setSharedParameter ("nightFade",
|
||||
sh::makeProperty<sh::FloatValue>(new sh::FloatValue(0)));
|
||||
sh::Factory::getInstance().setSharedParameter ("atmosphereColour", sh::makeProperty<sh::Vector4>(new sh::Vector4(0,0,0,1)));
|
||||
sh::Factory::getInstance().setSharedParameter ("horizonColour", sh::makeProperty<sh::Vector4>(new sh::Vector4(0,0,0,1)));
|
||||
|
||||
sh::Factory::getInstance().setTextureAlias ("cloud_texture_1", "");
|
||||
sh::Factory::getInstance().setTextureAlias ("cloud_texture_2", "");
|
||||
|
@ -488,6 +489,13 @@ void SkyManager::setWeather(const MWWorld::WeatherResult& weather)
|
|||
weather.mSkyColor.r, weather.mSkyColor.g, weather.mSkyColor.b, weather.mSkyColor.a)));
|
||||
}
|
||||
|
||||
if (mFogColour != weather.mFogColor)
|
||||
{
|
||||
mFogColour = weather.mFogColor;
|
||||
sh::Factory::getInstance().setSharedParameter ("horizonColour", sh::makeProperty<sh::Vector4>(new sh::Vector4(
|
||||
weather.mFogColor.r, weather.mFogColor.g, weather.mFogColor.b, weather.mFogColor.a)));
|
||||
}
|
||||
|
||||
mCloudSpeed = weather.mCloudSpeed;
|
||||
|
||||
if (weather.mNight && mStarsOpacity != weather.mNightFade)
|
||||
|
|
|
@ -211,6 +211,7 @@ namespace MWRender
|
|||
float mStarsOpacity;
|
||||
Ogre::ColourValue mCloudColour;
|
||||
Ogre::ColourValue mSkyColour;
|
||||
Ogre::ColourValue mFogColour;
|
||||
|
||||
Ogre::Light* mLightning;
|
||||
|
||||
|
|
|
@ -18,10 +18,11 @@
|
|||
SH_BEGIN_PROGRAM
|
||||
shInput(float, alphaFade)
|
||||
shUniform(float4, atmosphereColour) @shSharedParameter(atmosphereColour)
|
||||
shUniform(float4, horizonColour) @shSharedParameter(horizonColour, horizonColour)
|
||||
|
||||
SH_START_PROGRAM
|
||||
{
|
||||
shOutputColour(0) = atmosphereColour * float4(1,1,1,alphaFade);
|
||||
shOutputColour(0) = alphaFade * atmosphereColour + (1.f - alphaFade) * horizonColour;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -59,7 +59,6 @@ material openmw_atmosphere
|
|||
|
||||
polygon_mode_overrideable off
|
||||
|
||||
scene_blend alpha_blend
|
||||
depth_write off
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue