Give meaningful name to the mEffectFade

pull/593/head
Andrei Kortunov 4 years ago
parent d805886de7
commit 38679013fe

@ -657,7 +657,7 @@ namespace MWRender
mUnrefQueue->flush(mWorkQueue.get());
float rainIntensity = mSky->getEffectFade();
float rainIntensity = mSky->getPrecipitationAlpha();
mWater->setRainIntensity(rainIntensity);
if (!paused)

@ -1138,7 +1138,7 @@ SkyManager::SkyManager(osg::Group* parentNode, Resource::SceneManager* sceneMana
, mBaseWindSpeed(0.f)
, mEnabled(true)
, mSunEnabled(true)
, mEffectFade(0.f)
, mPrecipitationAlpha(0.f)
{
osg::ref_ptr<CameraRelativeTransform> skyroot (new CameraRelativeTransform);
skyroot->setName("Sky Root");
@ -1516,7 +1516,7 @@ void SkyManager::createRain()
osg::ref_ptr<osgParticle::ModularProgram> program (new osgParticle::ModularProgram);
program->addOperator(new WrapAroundOperator(mCamera,rainRange));
program->addOperator(new WeatherAlphaOperator(mEffectFade, true));
program->addOperator(new WeatherAlphaOperator(mPrecipitationAlpha, true));
program->setParticleSystem(mRainParticleSystem);
mRainNode->addChild(program);
@ -1575,10 +1575,10 @@ bool SkyManager::hasRain() const
return mRainNode != nullptr;
}
float SkyManager::getEffectFade() const
float SkyManager::getPrecipitationAlpha() const
{
if (mEnabled && !mIsStorm && (hasRain() || mParticleNode))
return mEffectFade;
return mPrecipitationAlpha;
return 0.f;
}
@ -1722,7 +1722,7 @@ void SkyManager::setWeather(const WeatherResult& weather)
SceneUtil::AssignControllerSourcesVisitor assignVisitor(std::shared_ptr<SceneUtil::ControllerSource>(new SceneUtil::FrameTimeSource));
mParticleEffect->accept(assignVisitor);
AlphaFader::SetupVisitor alphaFaderSetupVisitor(mEffectFade);
AlphaFader::SetupVisitor alphaFaderSetupVisitor(mPrecipitationAlpha);
mParticleEffect->accept(alphaFaderSetupVisitor);
@ -1739,7 +1739,7 @@ void SkyManager::setWeather(const WeatherResult& weather)
osg::ref_ptr<osgParticle::ModularProgram> program (new osgParticle::ModularProgram);
if (!mIsStorm)
program->addOperator(new WrapAroundOperator(mCamera,osg::Vec3(1024,1024,800)));
program->addOperator(new WeatherAlphaOperator(mEffectFade, false));
program->addOperator(new WeatherAlphaOperator(mPrecipitationAlpha, false));
program->setParticleSystem(ps);
mParticleNode->addChild(program);
}
@ -1828,7 +1828,7 @@ void SkyManager::setWeather(const WeatherResult& weather)
mAtmosphereNightNode->setNodeMask(weather.mNight ? ~0 : 0);
mEffectFade = weather.mEffectFade;
mPrecipitationAlpha = weather.mPrecipitationAlpha;
}
float SkyManager::getBaseWindSpeed() const

@ -87,7 +87,7 @@ namespace MWRender
std::string mParticleEffect;
std::string mRainEffect;
float mEffectFade;
float mPrecipitationAlpha;
float mRainDiameter;
float mRainMinHeight;
@ -158,7 +158,7 @@ namespace MWRender
bool hasRain() const;
float getEffectFade() const;
float getPrecipitationAlpha() const;
void setRainSpeed(float speed);
@ -269,7 +269,7 @@ namespace MWRender
bool mEnabled;
bool mSunEnabled;
float mEffectFade;
float mPrecipitationAlpha;
osg::Vec4f mMoonScriptColor;
};

@ -1129,7 +1129,7 @@ inline void WeatherManager::calculateResult(const int weatherID, const float gam
mResult.mGlareView = current.mGlareView;
mResult.mAmbientLoopSoundID = current.mAmbientLoopSoundID;
mResult.mAmbientSoundVolume = 1.f;
mResult.mEffectFade = 1.f;
mResult.mPrecipitationAlpha = 1.f;
mResult.mIsStorm = current.mIsStorm;
@ -1236,7 +1236,7 @@ inline void WeatherManager::calculateTransitionResult(const float factor, const
mResult.mRainSpeed = current.mRainSpeed;
mResult.mRainEntranceSpeed = current.mRainEntranceSpeed;
mResult.mAmbientSoundVolume = 1 - factor / threshold;
mResult.mEffectFade = mResult.mAmbientSoundVolume;
mResult.mPrecipitationAlpha = mResult.mAmbientSoundVolume;
mResult.mAmbientLoopSoundID = current.mAmbientLoopSoundID;
mResult.mRainDiameter = current.mRainDiameter;
mResult.mRainMinHeight = current.mRainMinHeight;
@ -1251,7 +1251,7 @@ inline void WeatherManager::calculateTransitionResult(const float factor, const
mResult.mRainSpeed = other.mRainSpeed;
mResult.mRainEntranceSpeed = other.mRainEntranceSpeed;
mResult.mAmbientSoundVolume = (factor - threshold) / (1 - threshold);
mResult.mEffectFade = mResult.mAmbientSoundVolume;
mResult.mPrecipitationAlpha = mResult.mAmbientSoundVolume;
mResult.mAmbientLoopSoundID = other.mAmbientLoopSoundID;
mResult.mRainDiameter = other.mRainDiameter;

Loading…
Cancel
Save