Poor LOD range selection during active grid object paging
Issue Description
For an active-grid chunk, right (mDistances) is {smallestDistanceToChunk, higherDistanceToChunk} — a heuristic guess at how far the camera could plausibly be from anything in this chunk while it's still in the active grid (((size < 1) ? 5 : 3) * cellSize * size + 1). It's not a real guarantee — the active grid doesn't re-select representations by distance the way the "far" quadtree chunk system does.
When left is a LOD child with range {X, FLT_MAX} (a "stay visible forever past X" level), min(left.second, right.second) collapses that FLT_MAX down to the finite higherDistanceToChunk. Then empty() checks max(left.first, right.first) >= result.second, which becomes true as soon as X >= higherDistanceToChunk. Once that happens, both AnalyzeVisitor::apply (used for merge-cost analysis) and CopyOp::operator() (which builds the actual copied osg::LOD) drop that child entirely — permanently, since the copy only happens once per node template. The unbounded far level never makes it into the rebuilt LOD node, so once you're past the nearer levels' finite ranges there's nothing left to render at runtime, and the object vanishes.
Steps to Reproduce
- Install a mod that adds meshes using LOD Nodes.
coc balmoratcl- Look down and fly straight upward.
- The meshes in only the active grid will become invisible.
System Information
- OpenMW Version: commit sha 01bcd6a6 on
master - Operating System & Version: opensuse
- GPU: nvidia
- Morrowind Version: steam
- Language: english
- Addons: Tribunal + Bloodmoon
Mods
- Are you using mods? Yes
- Are you using any shader mods? Yes
- Does it happen in a clean vanilla install? Untested
Logs and Settings
[Terrain]
distant terrain = true
object paging active grid = true