mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-03 16:45:34 +00:00
Make sure render textures are inactive when in a cell without water
This commit is contained in:
parent
867b22ce19
commit
002830e13b
3 changed files with 10 additions and 2 deletions
|
@ -99,4 +99,9 @@ namespace MWRender
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Refraction::setActive(bool active)
|
||||||
|
{
|
||||||
|
mRenderTarget->setActive(active);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,7 @@ namespace MWRender
|
||||||
void preRenderTargetUpdate(const Ogre::RenderTargetEvent& evt);
|
void preRenderTargetUpdate(const Ogre::RenderTargetEvent& evt);
|
||||||
void postRenderTargetUpdate(const Ogre::RenderTargetEvent& evt);
|
void postRenderTargetUpdate(const Ogre::RenderTargetEvent& evt);
|
||||||
void setUnderwater(bool underwater) {mIsUnderwater = underwater;}
|
void setUnderwater(bool underwater) {mIsUnderwater = underwater;}
|
||||||
|
void setActive (bool active);
|
||||||
|
|
||||||
void renderQueueStarted (Ogre::uint8 queueGroupId, const Ogre::String &invocation, bool &skipThisInvocation);
|
void renderQueueStarted (Ogre::uint8 queueGroupId, const Ogre::String &invocation, bool &skipThisInvocation);
|
||||||
void renderQueueEnded (Ogre::uint8 queueGroupId, const Ogre::String &invocation, bool &repeatThisInvocation);
|
void renderQueueEnded (Ogre::uint8 queueGroupId, const Ogre::String &invocation, bool &repeatThisInvocation);
|
||||||
|
|
|
@ -372,9 +372,9 @@ void Water::updateVisible()
|
||||||
{
|
{
|
||||||
mWater->setVisible(mToggled && mActive);
|
mWater->setVisible(mToggled && mActive);
|
||||||
if (mReflection)
|
if (mReflection)
|
||||||
{
|
|
||||||
mReflection->setActive(mToggled && mActive);
|
mReflection->setActive(mToggled && mActive);
|
||||||
}
|
if (mRefraction)
|
||||||
|
mRefraction->setActive(mToggled && mActive);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Water::update(float dt, Ogre::Vector3 player)
|
void Water::update(float dt, Ogre::Vector3 player)
|
||||||
|
@ -424,6 +424,8 @@ void Water::applyRTT()
|
||||||
mRefraction = new Refraction(mCamera);
|
mRefraction = new Refraction(mCamera);
|
||||||
mRefraction->setHeight(mTop);
|
mRefraction->setHeight(mTop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateVisible();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Water::applyVisibilityMask()
|
void Water::applyVisibilityMask()
|
||||||
|
|
Loading…
Reference in a new issue