Skip to content

Commit

Permalink
check if farther details level is greater than closer
Browse files Browse the repository at this point in the history
  • Loading branch information
tritonas00 authored and Petr Ohlídal committed Mar 19, 2022
1 parent 95a32fc commit f6b80c0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion source/main/terrain/TerrainObjectManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,13 @@ void TerrainObjectManager::ProcessTree(
float max = maxDist * terrainManager->getPagedDetailFactor();
if (max < 10)
max = 10;
geom->addDetailLevel<ImpostorPage>(max, max / 10);

// Check if farther details level is greater than closer
if (max / 10 > min / 2)
{
geom->addDetailLevel<ImpostorPage>(max, max / 10);
}

TreeLoader2D *treeLoader = new TreeLoader2D(geom, TBounds(0, 0, mapsizex, mapsizez));
geom->setPageLoader(treeLoader);
treeLoader->setHeightFunction(&getTerrainHeight);
Expand Down

0 comments on commit f6b80c0

Please # to comment.