forked from teamnwah/openmw-tes3coop
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 postRenderTargetUpdate(const Ogre::RenderTargetEvent& evt);
|
||||
void setUnderwater(bool underwater) {mIsUnderwater = underwater;}
|
||||
void setActive (bool active);
|
||||
|
||||
void renderQueueStarted (Ogre::uint8 queueGroupId, const Ogre::String &invocation, bool &skipThisInvocation);
|
||||
void renderQueueEnded (Ogre::uint8 queueGroupId, const Ogre::String &invocation, bool &repeatThisInvocation);
|
||||
|
|
|
@ -372,9 +372,9 @@ void Water::updateVisible()
|
|||
{
|
||||
mWater->setVisible(mToggled && mActive);
|
||||
if (mReflection)
|
||||
{
|
||||
mReflection->setActive(mToggled && mActive);
|
||||
}
|
||||
if (mRefraction)
|
||||
mRefraction->setActive(mToggled && mActive);
|
||||
}
|
||||
|
||||
void Water::update(float dt, Ogre::Vector3 player)
|
||||
|
@ -424,6 +424,8 @@ void Water::applyRTT()
|
|||
mRefraction = new Refraction(mCamera);
|
||||
mRefraction->setHeight(mTop);
|
||||
}
|
||||
|
||||
updateVisible();
|
||||
}
|
||||
|
||||
void Water::applyVisibilityMask()
|
||||
|
|
Loading…
Reference in a new issue