From 7e69978f407d39d23f2062246dd40c3ba1c6bb1a Mon Sep 17 00:00:00 2001 From: Kelsi Date: Mon, 9 Feb 2026 19:04:41 -0800 Subject: [PATCH] Refine LOD culling with combined Z and size threshold MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previous threshold (worldZ > 150) was too aggressive and hid Group 95 at worldZ=162 which is legitimate cathedral geometry. New approach: Only hide groups that are BOTH: - High: worldZ > 180 - Very tall: sizeZ > 100 This specifically targets ONLY the floating shell: - Group 92: worldZ=225, sizeZ=251 ✓ culled - Group 93: worldZ=201, sizeZ=165 ✓ culled While preserving legitimate geometry: - Group 95: worldZ=162, sizeZ=131 ✓ kept (Z < 180) - All other groups: Z < 180 ✓ kept --- 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 464d35d8..ee7893f0 100644 --- a/src/rendering/wmo_renderer.cpp +++ b/src/rendering/wmo_renderer.cpp @@ -1020,13 +1020,16 @@ void WMORenderer::render(const Camera& camera, const glm::mat4& view, const glm: 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 + // Groups 92/93 are at worldZ 200-225 (floating shell with massive height) + // Group 95 at worldZ=162 is legitimate (keep it) glm::vec3 groupCenter = (group.boundingBoxMin + group.boundingBoxMax) * 0.5f; glm::vec4 worldCenter = instance.modelMatrix * glm::vec4(groupCenter, 1.0f); + glm::vec3 size = group.boundingBoxMax - group.boundingBoxMin; - if (worldCenter.z > 150.0f) { - continue; // Skip groups positioned above Z=150 (floating LOD shell) + // Skip groups that are both HIGH (worldZ > 180) AND very tall (sizeZ > 100) + // This catches groups 92 (worldZ=225, sizeZ=251) and 93 (worldZ=201, sizeZ=165) + if (worldCenter.z > 180.0f && size.z > 100.0f) { + continue; // Skip floating LOD shell } renderGroup(group, model, instance.modelMatrix, view, projection);