mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-21 09:09:43 +00:00
Select only one level of LOD outside the active grid
Do not create group when not needed
This commit is contained in:
parent
4140e4ea05
commit
7142bb4ce7
1 changed files with 6 additions and 7 deletions
|
@ -186,12 +186,7 @@ namespace MWRender
|
|||
return nullptr;
|
||||
|
||||
if (children.size() == 1)
|
||||
{
|
||||
osg::Group* n = new osg::Group;
|
||||
n->addChild(children.front().first);
|
||||
n->setDataVariance(osg::Object::STATIC);
|
||||
return n;
|
||||
}
|
||||
return children.front().first.release();
|
||||
else
|
||||
{
|
||||
osg::LOD* n = new osg::LOD;
|
||||
|
@ -572,7 +567,11 @@ namespace MWRender
|
|||
constexpr auto copyMask = ~Mask_UpdateVisitor;
|
||||
|
||||
const auto smallestDistanceToChunk = (size > 1 / 8.f) ? (size * ESM::Land::REAL_SIZE) : 0.f;
|
||||
const auto higherDistanceToChunk = ((size < 1) ? 5 : 3) * ESM::Land::REAL_SIZE * size + 1;
|
||||
const auto higherDistanceToChunk = [&] {
|
||||
if (!activeGrid)
|
||||
return smallestDistanceToChunk + 1;
|
||||
return ((size < 1) ? 5 : 3) * ESM::Land::REAL_SIZE * size + 1;
|
||||
}();
|
||||
|
||||
AnalyzeVisitor analyzeVisitor(copyMask);
|
||||
float minSize = mMinSize;
|
||||
|
|
Loading…
Reference in a new issue