diff --git a/apps/openmw/mwgui/loadingscreen.cpp b/apps/openmw/mwgui/loadingscreen.cpp index 8fecf4c34b..dd5289edb1 100644 --- a/apps/openmw/mwgui/loadingscreen.cpp +++ b/apps/openmw/mwgui/loadingscreen.cpp @@ -150,7 +150,7 @@ namespace MWGui if (!mFirstLoad) { mBackgroundMaterial->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureName(chain->getCompositor ("gbufferFinalizer")->getTextureInstance ("no_mrt_output", 0)->getName()); - //mRectangle->setVisible(true); + mRectangle->setVisible(true); } for (unsigned int i = 0; igetNumCompositors(); ++i) diff --git a/apps/openmw/mwrender/localmap.cpp b/apps/openmw/mwrender/localmap.cpp index 1d338df122..3a906138b8 100644 --- a/apps/openmw/mwrender/localmap.cpp +++ b/apps/openmw/mwrender/localmap.cpp @@ -187,15 +187,6 @@ void LocalMap::render(const float x, const float y, const float zlow, const float zhigh, const float xw, const float yw, const std::string& texture) { - // disable fog (only necessary for fixed function, the shader based - // materials already do this through local_map material configuration) - const float fStart = mRendering->getScene()->getFogStart(); - const float fEnd = mRendering->getScene()->getFogEnd(); - const ColourValue& clr = mRendering->getScene()->getFogColour(); - mRendering->getScene()->setFog(FOG_NONE); - - // make everything visible - mCameraNode->setPosition(Vector3(x, zhigh+100000, y)); //mCellCamera->setFarClipDistance( (zhigh-zlow) * 1.1 ); mCellCamera->setFarClipDistance(0); // infinite @@ -224,6 +215,9 @@ void LocalMap::render(const float x, const float y, TU_RENDERTARGET); RenderTarget* rtt = tex->getBuffer()->getRenderTarget(); + + mCameraSettings[rtt] = Vector3(x, zhigh+100000, y); + rtt->setAutoUpdated(false); Viewport* vp = rtt->addViewport(mCellCamera); vp->setOverlaysEnabled(false); @@ -266,13 +260,19 @@ void LocalMap::render(const float x, const float y, //rtt->writeContentsToFile("./" + texture + ".jpg"); } } - - // re-enable fog - mRendering->getScene()->setFog(FOG_LINEAR, clr, 0, fStart, fEnd); } void LocalMap::preRenderTargetUpdate(const Ogre::RenderTargetEvent& evt) { + // disable fog (only necessary for fixed function, the shader based + // materials already do this through local_map material configuration) + mOldFogStart = mRendering->getScene()->getFogStart(); + mOldFogEnd = mRendering->getScene()->getFogEnd(); + mOldFogClr = mRendering->getScene()->getFogColour(); + mRendering->getScene()->setFog(FOG_NONE); + + mCellCamera->setPosition(mCameraSettings[evt.source]); + mRenderingManager->disableLights(true); mLight->setVisible(true); evt.source->setAutoUpdated(false); @@ -283,6 +283,9 @@ void LocalMap::postRenderTargetUpdate(const Ogre::RenderTargetEvent& evt) mRenderingManager->enableLights(true); mLight->setVisible(false); evt.source->removeListener(this); + + // re-enable fog + mRendering->getScene()->setFog(FOG_LINEAR, mOldFogClr, 0, mOldFogStart, mOldFogEnd); } void LocalMap::getInteriorMapPosition (Ogre::Vector2 pos, float& nX, float& nY, int& x, int& y) diff --git a/apps/openmw/mwrender/localmap.hpp b/apps/openmw/mwrender/localmap.hpp index 2b1aa3f625..1f528f1386 100644 --- a/apps/openmw/mwrender/localmap.hpp +++ b/apps/openmw/mwrender/localmap.hpp @@ -4,6 +4,7 @@ #include #include +#include #include namespace MWWorld @@ -120,6 +121,13 @@ namespace MWRender int mCellX, mCellY; Ogre::AxisAlignedBox mBounds; std::string mInteriorName; + + Ogre::ColourValue mOldFogClr; + float mOldFogStart; + float mOldFogEnd; + + // maps texture name to according camera settings + std::map mCameraSettings; }; } diff --git a/apps/openmw/mwrender/water.cpp b/apps/openmw/mwrender/water.cpp index 0eb35323db..f2854c879a 100644 --- a/apps/openmw/mwrender/water.cpp +++ b/apps/openmw/mwrender/water.cpp @@ -401,7 +401,7 @@ void Water::update(float dt, Ogre::Vector3 player) mRendering->getSkyManager ()->setGlareEnabled (!mIsUnderwater); - //if (player.y <= mTop) + if (player.y <= mTop) { mSimulation->addImpulse(Ogre::Vector2(player.x, player.z)); }