Revise LOD culling: hide distant groups when near WMO

Changed culling strategy based on observation:
- Previous: Hide groups with <100 verts when close
- New: Hide groups >200 units away when you're <300 units from WMO

The floating cathedral is likely Groups 281/283/284/285 which are:
- High detail (23k-28k verts)
- Far away (200-569 units from camera)
- Meant to show the cathedral from a distance

When you're actually near/inside the cathedral (distToWMO < 300),
these distant views should be hidden and only the close-up geometry
(Group 257 at 20 units) should render.
This commit is contained in:
Kelsi 2026-02-09 18:57:22 -08:00
parent ddd2e1aad7
commit 2089853e97

View file

@ -1013,14 +1013,17 @@ void WMORenderer::render(const Camera& camera, const glm::mat4& view, const glm:
for (uint32_t gi : dl.visibleGroups) {
const auto& group = model.groups[gi];
// LOD shell culling: hide low-detail groups (<100 verts) when camera is close (<500 units)
// This prevents the floating "distant shell" from rendering when you're near the cathedral
// LOD shell culling: hide distant groups when camera is close to WMO
// The "floating cathedral" is likely a distant LOD that should hide when you're near
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));
float distToWMO = glm::length(cameraPos - instance.position);
if (group.vertexCount < 100 && distToGroup < 500.0f) {
continue; // Skip LOD shell when close
// Skip groups that are far from camera (>200 units) when you're close to the WMO (<300 units)
// This hides the distant cathedral view when you're actually near/inside it
if (distToWMO < 300.0f && distToGroup > 200.0f) {
continue; // Skip distant LOD when near WMO
}
renderGroup(group, model, instance.modelMatrix, view, projection);