From 4dfbcbb6f5a048576de1083cda75f5e02bd1d5b9 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Mon, 9 Feb 2026 19:03:02 -0800 Subject: [PATCH] Fix floating cathedral by culling high-Z LOD shell groups Identified the floating LOD shell from Z-position analysis: - Group 92: worldZ=225 (flags=0x7d2, 251.5 units tall!) - Group 93: worldZ=201.6 (flags=0x7e1, 165.4 units tall!) These groups are positioned WAY above the normal cathedral geometry (which sits at worldZ 98-122). They're the simplified distant shell meant to make the cathedral look impressive from far away. Fix: Skip rendering groups with worldZ > 150.0 This hides the floating shell while keeping all normal cathedral geometry visible. The threshold of 150 sits safely between: - Normal cathedral: 98-122 - Floating shell: 200-225 --- src/rendering/wmo_renderer.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/rendering/wmo_renderer.cpp b/src/rendering/wmo_renderer.cpp index f68f0004..464d35d8 100644 --- a/src/rendering/wmo_renderer.cpp +++ b/src/rendering/wmo_renderer.cpp @@ -1014,9 +1014,22 @@ void WMORenderer::render(const Camera& camera, const glm::mat4& view, const glm: loggedStormwindGroups = true; // Only log once to avoid spam } - // Render groups (culling disabled for debugging) + // Render groups with floating LOD shell culling + glm::vec3 cameraPos = camera.getPosition(); for (uint32_t gi : dl.visibleGroups) { - renderGroup(model.groups[gi], model, instance.modelMatrix, view, projection); + const auto& group = model.groups[gi]; + + // Hide floating LOD shell groups that are positioned too high + // Groups 92/93 are at worldZ 200-225 (floating shell) + // Normal cathedral groups are at worldZ 98-122 + glm::vec3 groupCenter = (group.boundingBoxMin + group.boundingBoxMax) * 0.5f; + glm::vec4 worldCenter = instance.modelMatrix * glm::vec4(groupCenter, 1.0f); + + if (worldCenter.z > 150.0f) { + continue; // Skip groups positioned above Z=150 (floating LOD shell) + } + + renderGroup(group, model, instance.modelMatrix, view, projection); } lastPortalCulledGroups += dl.portalCulled;