Refine LOD culling with combined Z and size threshold

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

View file

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