From f49131e1b8a2c8a1976c643b77eb76f56b4bcb42 Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 5 Apr 2012 13:09:59 +0200 Subject: [PATCH] renamed setting, automatically disable MRT when unsupported --- apps/openmw/mwrender/renderingmanager.cpp | 6 ++++++ apps/openmw/mwrender/water.cpp | 2 +- files/settings-default.cfg | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index ce4dea74d..97312b697 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -37,6 +37,12 @@ RenderingManager::RenderingManager (OEngine::Render::OgreRenderer& _rend, const // Load resources ResourceGroupManager::getSingleton().initialiseAllResourceGroups(); + // disable MRT if it is unsupported + const RenderSystemCapabilities* caps = Root::getSingleton().getRenderSystem()->getCapabilities(); + if (caps->getNumMultiRenderTargets() < 2 + || (!caps->isShaderProfileSupported("fp40") && !caps->isShaderProfileSupported("ps_3_0"))) + Settings::Manager::setBool("multiple render targets", "Render", false); + if (Settings::Manager::getBool("multiple render targets", "Render")) { CompositorManager::getSingleton().addCompositor(mRendering.getViewport(), "gbuffer"); diff --git a/apps/openmw/mwrender/water.cpp b/apps/openmw/mwrender/water.cpp index 1caced9f5..7e9dd957b 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("reflection", "Water")) + if (Settings::Manager::getBool("shader", "Water") && Settings::Manager::getBool("multiple render targets", "Render")) { TexturePtr tex = TextureManager::getSingleton().createManual("WaterReflection", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, TEX_TYPE_2D, rttsize, rttsize, 0, PF_R8G8B8, TU_RENDERTARGET); diff --git a/files/settings-default.cfg b/files/settings-default.cfg index 9be18f61b..7791f39ab 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -44,7 +44,7 @@ num lights = 8 [Water] -reflection = false +shader = false rtt size = 256