Add shadow toggle (F4) and distance-based WMO group culling

Shadow toggle allows disabling shadow pass for performance testing.
Distance culling skips WMO groups beyond 200 units. Occlusion queries
disabled by default as overhead outweighs benefits in dense scenes.
This commit is contained in:
Kelsi 2026-02-05 16:11:24 -08:00
parent 83ef27c570
commit ebf349ec7c
5 changed files with 29 additions and 11 deletions

View file

@ -184,7 +184,13 @@ private:
glm::mat4 lightSpaceMatrix = glm::mat4(1.0f);
glm::vec3 shadowCenter = glm::vec3(0.0f);
bool shadowCenterInitialized = false;
bool shadowsEnabled = true;
public:
void setShadowsEnabled(bool enabled) { shadowsEnabled = enabled; }
bool areShadowsEnabled() const { return shadowsEnabled; }
private:
void initShadowMap();
void renderShadowPass();
uint32_t compileShadowShader();

View file

@ -428,7 +428,7 @@ private:
bool frustumCulling = true;
bool portalCulling = false; // Disabled by default - needs debugging
bool distanceCulling = false; // Disabled - causes ground to disappear
bool occlusionCulling = true; // GPU occlusion queries
bool occlusionCulling = false; // GPU occlusion queries - disabled, adds overhead
float maxGroupDistance = 500.0f;
float maxGroupDistanceSq = 250000.0f; // maxGroupDistance^2
uint32_t lastDrawCalls = 0;