mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-25 06:35:30 +00:00
underwater tweaks
This commit is contained in:
parent
2976625b00
commit
c169f9e171
@ -18,6 +18,8 @@ enum RenderQueueGroups
|
||||
|
||||
RQG_Alpha = Ogre::RENDER_QUEUE_7,
|
||||
|
||||
RQG_UnderWater = Ogre::RENDER_QUEUE_7+1,
|
||||
|
||||
RQG_OcclusionQuery = Ogre::RENDER_QUEUE_8,
|
||||
|
||||
// Sky late (sun & sun flare)
|
||||
|
@ -54,6 +54,7 @@ RenderingManager::RenderingManager (OEngine::Render::OgreRenderer& _rend, const
|
||||
if (caps->getNumMultiRenderTargets() < 2)
|
||||
Settings::Manager::setBool("shader", "Water", false);
|
||||
|
||||
// note that the order is important here
|
||||
if (useMRT())
|
||||
{
|
||||
CompositorManager::getSingleton().addCompositor(mRendering.getViewport(), "gbuffer");
|
||||
@ -61,6 +62,7 @@ RenderingManager::RenderingManager (OEngine::Render::OgreRenderer& _rend, const
|
||||
CompositorManager::getSingleton().addCompositor(mRendering.getViewport(), "gbufferFinalizer");
|
||||
CompositorManager::getSingleton().setCompositorEnabled(mRendering.getViewport(), "gbufferFinalizer", true);
|
||||
}
|
||||
CompositorManager::getSingleton().addCompositor(mRendering.getViewport(), "Water");
|
||||
|
||||
// Turn the entire scene (represented by the 'root' node) -90
|
||||
// degrees around the x axis. This makes Z go upwards, and Y go into
|
||||
|
@ -16,7 +16,6 @@ Water::Water (Ogre::Camera *camera, SkyManager* sky, const ESM::Cell* cell) :
|
||||
|
||||
try
|
||||
{
|
||||
CompositorManager::getSingleton().addCompositor(mViewport, "Water", -1);
|
||||
CompositorManager::getSingleton().setCompositorEnabled(mViewport, "Water", false);
|
||||
} catch(...) {}
|
||||
|
||||
@ -76,7 +75,7 @@ Water::Water (Ogre::Camera *camera, SkyManager* sky, const ESM::Cell* cell) :
|
||||
void Water::setActive(bool active)
|
||||
{
|
||||
mActive = active;
|
||||
if (mReflectionTarget) mReflectionTarget->setActive(active);
|
||||
if (mReflectionTarget) mReflectionTarget->setActive(active && !mIsUnderwater);
|
||||
mWater->setVisible(active);
|
||||
}
|
||||
|
||||
@ -130,6 +129,8 @@ void Water::checkUnderwater(float y)
|
||||
if (mReflectionTarget)
|
||||
mReflectionTarget->setActive(mActive);
|
||||
|
||||
mWater->setRenderQueueGroup(RQG_Water);
|
||||
|
||||
mIsUnderwater = false;
|
||||
}
|
||||
|
||||
@ -147,6 +148,8 @@ void Water::checkUnderwater(float y)
|
||||
if (mReflectionTarget)
|
||||
mReflectionTarget->setActive(false);
|
||||
|
||||
mWater->setRenderQueueGroup(RQG_UnderWater);
|
||||
|
||||
mIsUnderwater = true;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user