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
This commit is contained in:
Kelsi 2026-02-09 19:03:02 -08:00
parent 252f29d29b
commit 4dfbcbb6f5

View file

@ -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;