|
1 | 1 | #include "objectpaging.hpp" |
2 | 2 |
|
3 | | -#include <type_traits> |
| 3 | +#include <limits> |
4 | 4 | #include <unordered_map> |
5 | 5 | #include <vector> |
6 | 6 |
|
@@ -677,6 +677,8 @@ namespace MWRender |
677 | 677 | const float smallestDistanceToChunk = (size > 1 / 8.f) ? (size * cellSize) : 0.f; |
678 | 678 | const float higherDistanceToChunk |
679 | 679 | = activeGrid ? ((size < 1) ? 5 : 3) * cellSize * size + 1 : smallestDistanceToChunk + 1; |
| 680 | + const LODRange lodDistances = activeGrid ? LODRange{ 0.f, std::numeric_limits<float>::max() } |
| 681 | + : LODRange{ smallestDistanceToChunk, higherDistanceToChunk }; |
680 | 682 |
|
681 | 683 | AnalyzeVisitor analyzeVisitor(copyMask); |
682 | 684 | const float minSize = mMinSizeMergeFactor ? mMinSize * mMinSizeMergeFactor : mMinSize; |
@@ -770,7 +772,7 @@ namespace MWRender |
770 | 772 | const auto emplaced = nodes.emplace(std::move(cnode), InstanceList()); |
771 | 773 | if (emplaced.second) |
772 | 774 | { |
773 | | - analyzeVisitor.mDistances = LODRange{ smallestDistanceToChunk, higherDistanceToChunk } / ref.mScale; |
| 775 | + analyzeVisitor.mDistances = lodDistances / ref.mScale; |
774 | 776 | const osg::Node* const nodePtr = emplaced.first->first.get(); |
775 | 777 | // const-trickery required because there is no const version of NodeVisitor |
776 | 778 | const_cast<osg::Node*>(nodePtr)->accept(analyzeVisitor); |
@@ -849,7 +851,7 @@ namespace MWRender |
849 | 851 | // BufferObjects of the original geometry. (ensured by needvbo() in optimizer.cpp) |
850 | 852 | copyop.setCopyFlags(merge ? osg::CopyOp::DEEP_COPY_NODES | osg::CopyOp::DEEP_COPY_DRAWABLES |
851 | 853 | : osg::CopyOp::DEEP_COPY_NODES); |
852 | | - copyop.mDistances = LODRange{ smallestDistanceToChunk, higherDistanceToChunk } / ref.mScale; |
| 854 | + copyop.mDistances = lodDistances / ref.mScale; |
853 | 855 | copyop.copy(cnode, trans); |
854 | 856 |
|
855 | 857 | if (activeGrid) |
|
0 commit comments