From 19d516cbda3d87262470fce898a4f76b5717817f Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 9 Mar 2017 03:49:40 +0100 Subject: [PATCH] Use the QuadTreeWorld based on distant terrain setting now that it sort of works. --- apps/openmw/mwrender/renderingmanager.cpp | 10 +++++++--- files/settings-default.cfg | 5 +++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwrender/renderingmanager.cpp b/apps/openmw/mwrender/renderingmanager.cpp index a8baf9530..40403a4fb 100644 --- a/apps/openmw/mwrender/renderingmanager.cpp +++ b/apps/openmw/mwrender/renderingmanager.cpp @@ -34,6 +34,7 @@ #include #include +#include #include #include @@ -212,12 +213,15 @@ namespace MWRender mWater.reset(new Water(mRootNode, sceneRoot, mResourceSystem, mViewer->getIncrementalCompileOperation(), fallback, resourcePath)); - - + const bool distantTerrain = Settings::Manager::getBool("distant terrain", "Terrain"); mTerrainStorage = new TerrainStorage(mResourceSystem, Settings::Manager::getString("normal map pattern", "Shaders"), Settings::Manager::getString("normal height map pattern", "Shaders"), Settings::Manager::getBool("auto use terrain normal maps", "Shaders"), Settings::Manager::getString("terrain specular map pattern", "Shaders"), Settings::Manager::getBool("auto use terrain specular maps", "Shaders")); - mTerrain.reset(new Terrain::TerrainGrid(sceneRoot, mRootNode, mResourceSystem, mTerrainStorage, Mask_Terrain, Mask_PreCompile)); + + if (distantTerrain) + mTerrain.reset(new Terrain::QuadTreeWorld(mWorkQueue.get(), sceneRoot, mRootNode, mResourceSystem, mTerrainStorage, Mask_Terrain, Mask_PreCompile)); + else + mTerrain.reset(new Terrain::TerrainGrid(sceneRoot, mRootNode, mResourceSystem, mTerrainStorage, Mask_Terrain, Mask_PreCompile)); mCamera.reset(new Camera(mViewer->getCamera())); diff --git a/files/settings-default.cfg b/files/settings-default.cfg index 91329b8ca..55f550d5a 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -76,6 +76,11 @@ preload cell expiry delay = 5 # How long to keep models/textures/collision shapes in cache after they're no longer referenced/required (in seconds) cache expiry delay = 5 +[Terrain] + +# If true, use paging and LOD algorithms to display the entire terrain. If false, only display terrain of the loaded cells +distant terrain = false + [Map] # Size of each exterior cell in pixels in the world map. (e.g. 12 to 24).