diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index c2ad2a0432..024c10f3d0 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -39,12 +39,12 @@ RenderingManager::RenderingManager (OEngine::Render::OgreRenderer& _rend, const // Load resources ResourceGroupManager::getSingleton().initialiseAllResourceGroups(); - // disable MRT if it is unsupported + // disable unsupported effects const RenderSystemCapabilities* caps = Root::getSingleton().getRenderSystem()->getCapabilities(); if (caps->getNumMultiRenderTargets() < 2) - Settings::Manager::setBool("multiple render targets", "Render", false); + Settings::Manager::setBool("shader", "Water", false); - if (Settings::Manager::getBool("multiple render targets", "Render")) + if (useMRT()) { CompositorManager::getSingleton().addCompositor(mRendering.getViewport(), "gbuffer"); CompositorManager::getSingleton().setCompositorEnabled(mRendering.getViewport(), "gbuffer", true); @@ -266,8 +266,11 @@ bool RenderingManager::toggleRenderMode(int mode) if (mRendering.getCamera()->getPolygonMode() == PM_SOLID) { // disable compositors - CompositorManager::getSingleton().setCompositorEnabled(mRendering.getViewport(), "gbuffer", false); - CompositorManager::getSingleton().setCompositorEnabled(mRendering.getViewport(), "gbufferFinalizer", false); + if (useMRT()) + { + CompositorManager::getSingleton().setCompositorEnabled(mRendering.getViewport(), "gbuffer", false); + CompositorManager::getSingleton().setCompositorEnabled(mRendering.getViewport(), "gbufferFinalizer", false); + } mRendering.getCamera()->setPolygonMode(PM_WIREFRAME); return true; @@ -275,7 +278,7 @@ bool RenderingManager::toggleRenderMode(int mode) else { // re-enable compositors - if (Settings::Manager::getBool("multiple render targets", "Render")) + if (useMRT()) { CompositorManager::getSingleton().setCompositorEnabled(mRendering.getViewport(), "gbuffer", true); CompositorManager::getSingleton().setCompositorEnabled(mRendering.getViewport(), "gbufferFinalizer", true); @@ -449,4 +452,9 @@ void RenderingManager::enableLights() mObjects.enableLights(); } +const bool RenderingManager::useMRT() +{ + return Settings::Manager::getBool("shader", "Water"); +} + } // namespace diff --git a/apps/openmw/mwrender/renderingmanager.hpp b/apps/openmw/mwrender/renderingmanager.hpp index 27cd67bbc0..da9c55cb5a 100644 --- a/apps/openmw/mwrender/renderingmanager.hpp +++ b/apps/openmw/mwrender/renderingmanager.hpp @@ -81,6 +81,8 @@ class RenderingManager: private RenderingInterface { void removeWater(); + static const bool useMRT(); + void preCellChange (MWWorld::Ptr::CellStore* store); ///< this event is fired immediately before changing cell diff --git a/apps/openmw/mwrender/terrainmaterial.cpp b/apps/openmw/mwrender/terrainmaterial.cpp index 867ec8e1fd..87798006c3 100644 --- a/apps/openmw/mwrender/terrainmaterial.cpp +++ b/apps/openmw/mwrender/terrainmaterial.cpp @@ -37,6 +37,7 @@ THE SOFTWARE. #include "OgreShadowCameraSetupPSSM.h" #include +#include "renderingmanager.hpp" namespace Ogre { @@ -558,7 +559,7 @@ namespace Ogre //params->setNamedAutoConstant("lightSpecularColour"+StringConverter::toString(i), GpuProgramParameters::ACT_LIGHT_SPECULAR_COLOUR, i); } - if (Settings::Manager::getBool("multiple render targets", "Render")) + if (MWRender::RenderingManager::useMRT()) params->setNamedAutoConstant("far", GpuProgramParameters::ACT_FAR_CLIP_DISTANCE); params->setNamedAutoConstant("eyePosObjSpace", GpuProgramParameters::ACT_CAMERA_POSITION_OBJECT_SPACE); @@ -1032,7 +1033,7 @@ namespace Ogre __FUNCTION__); } - if (Settings::Manager::getBool("multiple render targets", "Render")) outStream << + if (MWRender::RenderingManager::useMRT()) outStream << " , out float4 oColor : COLOR \n" " , out float4 oColor1 : COLOR1 \n" " , uniform float far \n"; @@ -1348,7 +1349,7 @@ namespace Ogre // Final return outStream << " oColor = outputCol;\n"; - if (Settings::Manager::getBool("multiple render targets", "Render")) outStream << + if (MWRender::RenderingManager::useMRT()) outStream << " oColor1 = float4(uvMisc.z / far, 0, 0, 1); \n"; outStream diff --git a/apps/openmw/mwrender/water.cpp b/apps/openmw/mwrender/water.cpp index d4ec9aeeaf..cbce0d0750 100644 --- a/apps/openmw/mwrender/water.cpp +++ b/apps/openmw/mwrender/water.cpp @@ -52,7 +52,7 @@ Water::Water (Ogre::Camera *camera, SkyManager* sky, const ESM::Cell* cell) : // Create rendertarget for reflection int rttsize = Settings::Manager::getInt("rtt size", "Water"); - if (Settings::Manager::getBool("shader", "Water") && Settings::Manager::getBool("multiple render targets", "Render")) + if (Settings::Manager::getBool("shader", "Water")) { TexturePtr tex = TextureManager::getSingleton().createManual("WaterReflection", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, TEX_TYPE_2D, rttsize, rttsize, 0, PF_R8G8B8, TU_RENDERTARGET); @@ -185,7 +185,7 @@ Ogre::MaterialPtr Water::createMaterial() if (mReflectionTarget == 0) mat->removeTechnique(0); - if (Settings::Manager::getBool("multiple render targets", "Render")) + if (Settings::Manager::getBool("shader", "Water")) { CompositorInstance* compositor = CompositorManager::getSingleton().getCompositorChain(mViewport)->getCompositor("gbuffer"); diff --git a/components/nifogre/ogre_nif_loader.cpp b/components/nifogre/ogre_nif_loader.cpp index 83510db139..d2b53291e6 100644 --- a/components/nifogre/ogre_nif_loader.cpp +++ b/components/nifogre/ogre_nif_loader.cpp @@ -302,7 +302,7 @@ void NIFLoader::createMaterial(const String &name, if (Settings::Manager::getBool("shaders", "Objects")) { - bool mrt = Settings::Manager::getBool("multiple render targets", "Render"); + bool mrt = Settings::Manager::getBool("shader", "Water"); // Create shader for the material // vertex diff --git a/files/settings-default.cfg b/files/settings-default.cfg index 7791f39ab1..90f832b998 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -57,9 +57,3 @@ reflect small statics = false reflect actors = true reflect misc = false - -[Render] - -# Only supported on SM3+ cards -# If you have a lower end card, this will be disabled automatically -multiple render targets = true