Merge branch 'UseSameDistanceForAllLodsOfTheCurrentChunk' into 'master'

Use same distance for all lods of the current chunk

Closes #6061

See merge request OpenMW/openmw!940
pull/593/head
psi29a 4 years ago
commit 071786aff6

@ -477,6 +477,8 @@ namespace MWRender
constexpr auto copyMask = ~Mask_UpdateVisitor; constexpr auto copyMask = ~Mask_UpdateVisitor;
AnalyzeVisitor analyzeVisitor(copyMask); AnalyzeVisitor analyzeVisitor(copyMask);
osg::Vec3f center3 = { center.x(), center.y(), 0.f };
analyzeVisitor.mCurrentDistance = (viewPoint - center3).length2();
float minSize = mMinSize; float minSize = mMinSize;
if (mMinSizeMergeFactor) if (mMinSizeMergeFactor)
minSize *= mMinSizeMergeFactor; minSize *= mMinSizeMergeFactor;
@ -546,7 +548,6 @@ namespace MWRender
continue; continue;
} }
analyzeVisitor.mCurrentDistance = dSqr;
auto emplaced = nodes.emplace(cnode, InstanceList()); auto emplaced = nodes.emplace(cnode, InstanceList());
if (emplaced.second) if (emplaced.second)
{ {

Loading…
Cancel
Save