EDIT: Forward-Z cascaded shadow map failed...

This commit is contained in:
2025-10-20 14:26:08 +09:00
parent b419cc1148
commit 4dec20b60f
5 changed files with 17 additions and 13 deletions

View File

@@ -122,7 +122,7 @@ void SceneManager::update_scene()
glm::vec3 up = glm::normalize(glm::cross(L, right));
const float csmFar = kShadowCSMFar; // configurable shadow distance
const float lambda = 0.8f; // split weighting
const float lambda = 0.5f; // split weighting
const int cascades = kShadowCascadeCount;
float splits[4] = {0, 0, 0, 0};
@@ -213,7 +213,9 @@ void SceneManager::update_scene()
float bottom = centerLS.y - radius;
float top = centerLS.y + radius;
mat4 projLight = orthoRH_ZO(left, rightE, bottom, top, nearLS, farLS);
mat4 projLight = orthoRH_ZO(-40.f, 40.f, -40.f, 40.f, nearLS, farLS);
// projLight[1][1] *= -1.0f;
return projLight * viewLight;
};