From f6b80c0630df4db450834cf8af2517a27b0250a9 Mon Sep 17 00:00:00 2001 From: tritonas00 Date: Fri, 18 Mar 2022 07:52:45 +0200 Subject: [PATCH] check if farther details level is greater than closer --- source/main/terrain/TerrainObjectManager.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/main/terrain/TerrainObjectManager.cpp b/source/main/terrain/TerrainObjectManager.cpp index 5c1f6b8331..5be2b2d5a3 100644 --- a/source/main/terrain/TerrainObjectManager.cpp +++ b/source/main/terrain/TerrainObjectManager.cpp @@ -310,7 +310,13 @@ void TerrainObjectManager::ProcessTree( float max = maxDist * terrainManager->getPagedDetailFactor(); if (max < 10) max = 10; - geom->addDetailLevel(max, max / 10); + + // Check if farther details level is greater than closer + if (max / 10 > min / 2) + { + geom->addDetailLevel(max, max / 10); + } + TreeLoader2D *treeLoader = new TreeLoader2D(geom, TBounds(0, 0, mapsizex, mapsizez)); geom->setPageLoader(treeLoader); treeLoader->setHeightFunction(&getTerrainHeight);