From 2089853e972b76a251f501ff43389057e31e7986 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Mon, 9 Feb 2026 18:57:22 -0800 Subject: [PATCH] Revise LOD culling: hide distant groups when near WMO Changed culling strategy based on observation: - Previous: Hide groups with <100 verts when close - New: Hide groups >200 units away when you're <300 units from WMO The floating cathedral is likely Groups 281/283/284/285 which are: - High detail (23k-28k verts) - Far away (200-569 units from camera) - Meant to show the cathedral from a distance When you're actually near/inside the cathedral (distToWMO < 300), these distant views should be hidden and only the close-up geometry (Group 257 at 20 units) should render. --- src/rendering/wmo_renderer.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/rendering/wmo_renderer.cpp b/src/rendering/wmo_renderer.cpp index 5efedde4..1b16bfbc 100644 --- a/src/rendering/wmo_renderer.cpp +++ b/src/rendering/wmo_renderer.cpp @@ -1013,14 +1013,17 @@ void WMORenderer::render(const Camera& camera, const glm::mat4& view, const glm: for (uint32_t gi : dl.visibleGroups) { const auto& group = model.groups[gi]; - // LOD shell culling: hide low-detail groups (<100 verts) when camera is close (<500 units) - // This prevents the floating "distant shell" from rendering when you're near the cathedral + // LOD shell culling: hide distant groups when camera is close to WMO + // The "floating cathedral" is likely a distant LOD that should hide when you're near glm::vec3 groupCenter = (group.boundingBoxMin + group.boundingBoxMax) * 0.5f; glm::vec4 worldCenter = instance.modelMatrix * glm::vec4(groupCenter, 1.0f); float distToGroup = glm::length(cameraPos - glm::vec3(worldCenter)); + float distToWMO = glm::length(cameraPos - instance.position); - if (group.vertexCount < 100 && distToGroup < 500.0f) { - continue; // Skip LOD shell when close + // Skip groups that are far from camera (>200 units) when you're close to the WMO (<300 units) + // This hides the distant cathedral view when you're actually near/inside it + if (distToWMO < 300.0f && distToGroup > 200.0f) { + continue; // Skip distant LOD when near WMO } renderGroup(group, model, instance.modelMatrix, view, projection);