|
|
|
@ -1316,23 +1316,21 @@ namespace MWRender
|
|
|
|
|
return existingChunkMgr->second;
|
|
|
|
|
RenderingManager::WorldspaceChunkMgr newChunkMgr;
|
|
|
|
|
|
|
|
|
|
const float lodFactor = Settings::Manager::getFloat("lod factor", "Terrain");
|
|
|
|
|
const float lodFactor = Settings::terrain().mLodFactor;
|
|
|
|
|
const bool groundcover = Settings::groundcover().mEnabled;
|
|
|
|
|
bool distantTerrain = Settings::Manager::getBool("distant terrain", "Terrain");
|
|
|
|
|
const bool distantTerrain = Settings::terrain().mDistantTerrain;
|
|
|
|
|
if (distantTerrain || groundcover)
|
|
|
|
|
{
|
|
|
|
|
const int compMapResolution = Settings::Manager::getInt("composite map resolution", "Terrain");
|
|
|
|
|
int compMapPower = Settings::Manager::getInt("composite map level", "Terrain");
|
|
|
|
|
compMapPower = std::max(-3, compMapPower);
|
|
|
|
|
float compMapLevel = pow(2, compMapPower);
|
|
|
|
|
const int vertexLodMod = Settings::Manager::getInt("vertex lod mod", "Terrain");
|
|
|
|
|
float maxCompGeometrySize = Settings::Manager::getFloat("max composite geometry size", "Terrain");
|
|
|
|
|
maxCompGeometrySize = std::max(maxCompGeometrySize, 1.f);
|
|
|
|
|
bool debugChunks = Settings::Manager::getBool("debug chunks", "Terrain");
|
|
|
|
|
const int compMapResolution = Settings::terrain().mCompositeMapResolution;
|
|
|
|
|
const int compMapPower = Settings::terrain().mCompositeMapLevel;
|
|
|
|
|
const float compMapLevel = std::pow(2, compMapPower);
|
|
|
|
|
const int vertexLodMod = Settings::terrain().mVertexLodMod;
|
|
|
|
|
const float maxCompGeometrySize = Settings::terrain().mMaxCompositeGeometrySize;
|
|
|
|
|
const bool debugChunks = Settings::terrain().mDebugChunks;
|
|
|
|
|
auto quadTreeWorld = std::make_unique<Terrain::QuadTreeWorld>(mSceneRoot, mRootNode, mResourceSystem,
|
|
|
|
|
mTerrainStorage.get(), Mask_Terrain, Mask_PreCompile, Mask_Debug, compMapResolution, compMapLevel,
|
|
|
|
|
lodFactor, vertexLodMod, maxCompGeometrySize, debugChunks, worldspace);
|
|
|
|
|
if (Settings::Manager::getBool("object paging", "Terrain"))
|
|
|
|
|
if (Settings::terrain().mObjectPaging)
|
|
|
|
|
{
|
|
|
|
|
newChunkMgr.mObjectPaging
|
|
|
|
|
= std::make_unique<ObjectPaging>(mResourceSystem->getSceneManager(), worldspace);
|
|
|
|
|