Add GPU occlusion query culling for WMO groups

Renders bounding boxes in depth-only pre-pass and queries GPU for
visibility. Groups fully occluded in previous frame are skipped.
Significantly improves performance in dense areas like Stormwind.
This commit is contained in:
Kelsi 2026-02-05 15:51:08 -08:00
parent 400e8652d4
commit 117bbad9ff
3 changed files with 241 additions and 12 deletions

View file

@ -370,6 +370,12 @@ void PerformanceHUD::render(const Renderer* renderer, const Camera* camera) {
ImGui::Text("Instances: %u", wmoRenderer->getInstanceCount());
ImGui::Text("Triangles: %u", wmoRenderer->getTotalTriangleCount());
ImGui::Text("Draw Calls: %u", wmoRenderer->getDrawCallCount());
if (wmoRenderer->isOcclusionCullingEnabled()) {
ImGui::Text("Occlusion Culled: %u groups", wmoRenderer->getOcclusionCulledGroups());
}
if (wmoRenderer->isDistanceCullingEnabled()) {
ImGui::Text("Distance Culled: %u groups", wmoRenderer->getDistanceCulledGroups());
}
if (wmoRenderer->isPortalCullingEnabled()) {
ImGui::Text("Portal Culled: %u groups", wmoRenderer->getPortalCulledGroups());
}