From 20bd54f9d4dd6ac8f40dec480807c6b36870712a Mon Sep 17 00:00:00 2001 From: Kelsi Date: Mon, 9 Feb 2026 18:43:37 -0800 Subject: [PATCH] Add WMO group flag logging for STORMWIND.WMO LOD detection Added detailed logging when rendering STORMWIND.WMO groups to identify the distant LOD shell that's causing the floating cathedral: - Group index - Group flags (hex) - will reveal which flag marks distant-only groups - Distance from camera to group center - Vertex count (helps identify simplified LOD geometry) Logs once per session to avoid spam. This will help us identify: 1. Which groups are the floating LOD shell 2. What flag value indicates 'distant view only' 3. Proper distance threshold for LOD culling Next step: Use flag pattern to hide distant groups when camera is close. --- src/rendering/wmo_renderer.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/rendering/wmo_renderer.cpp b/src/rendering/wmo_renderer.cpp index a5b4c0cd..83562862 100644 --- a/src/rendering/wmo_renderer.cpp +++ b/src/rendering/wmo_renderer.cpp @@ -991,6 +991,23 @@ void WMORenderer::render(const Camera& camera, const glm::mat4& view, const glm: shader->setUniform("uModel", instance.modelMatrix); + // Debug logging for STORMWIND.WMO groups to identify LOD shell + static bool loggedStormwindGroups = false; + if (!loggedStormwindGroups && instance.modelId == 10047) { + glm::vec3 cameraPos = camera.getPosition(); + float distToWMO = glm::length(cameraPos - instance.position); + LOG_INFO("=== STORMWIND.WMO Group Rendering (dist=", distToWMO, ") ==="); + for (uint32_t gi : dl.visibleGroups) { + const auto& group = model.groups[gi]; + 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)); + LOG_INFO(" Group ", gi, ": flags=0x", std::hex, group.groupFlags, std::dec, + " dist=", distToGroup, " verts=", group.vertexCount); + } + loggedStormwindGroups = true; // Only log once to avoid spam + } + for (uint32_t gi : dl.visibleGroups) renderGroup(model.groups[gi], model, instance.modelMatrix, view, projection);