fix rain ripple bug

pull/303/head
Miloslav Číž 7 years ago
parent 64793a55dc
commit 4999c667b6

@ -504,6 +504,9 @@ namespace MWRender
mWater->update(dt); mWater->update(dt);
} }
if (!mSky->isEnabled() || !mSky->hasRain())
clearRainRipples();
mCamera->update(dt, paused); mCamera->update(dt, paused);
osg::Vec3f focal, cameraPos; osg::Vec3f focal, cameraPos;
@ -803,7 +806,11 @@ namespace MWRender
{ {
mEffectManager->clear(); mEffectManager->clear();
mWater->clearRipples(); mWater->clearRipples();
mUniformRainIntensity->set((float) 0.0); // for interiors }
void RenderingManager::clearRainRipples()
{
mUniformRainIntensity->set((float) 0.0);
} }
void RenderingManager::clear() void RenderingManager::clear()

@ -160,6 +160,8 @@ namespace MWRender
/// Clear all worldspace-specific data /// Clear all worldspace-specific data
void notifyWorldSpaceChanged(); void notifyWorldSpaceChanged();
void clearRainRipples();
void update(float dt, bool paused); void update(float dt, bool paused);
Animation* getAnimation(const MWWorld::Ptr& ptr); Animation* getAnimation(const MWWorld::Ptr& ptr);

@ -1431,6 +1431,16 @@ int SkyManager::getSecundaPhase() const
return mSecunda->getPhaseInt(); return mSecunda->getPhaseInt();
} }
bool SkyManager::isEnabled()
{
return mEnabled;
}
bool SkyManager::hasRain()
{
return mRainNode != NULL;
}
void SkyManager::update(float duration) void SkyManager::update(float duration)
{ {
if (!mEnabled) return; if (!mEnabled) return;

@ -138,6 +138,10 @@ namespace MWRender
void sunDisable(); void sunDisable();
bool isEnabled();
bool hasRain();
void setRainSpeed(float speed); void setRainSpeed(float speed);
void setStormDirection(const osg::Vec3f& direction); void setStormDirection(const osg::Vec3f& direction);

Loading…
Cancel
Save