Merge pull request #1015 from carlkuesters/feature-fix-cascading-shadows-frustum-corner-calculation

Fix frustum corner calculation for cascading shadows (Vulkan's clip space has a [0,1] z range instead of [-1,1])
This commit is contained in:
Sascha Willems 2023-02-21 17:17:07 +01:00 committed by GitHub
commit 0031d35b7b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -663,10 +663,10 @@ public:
float splitDist = cascadeSplits[i];
glm::vec3 frustumCorners[8] = {
glm::vec3(-1.0f, 1.0f, -1.0f),
glm::vec3( 1.0f, 1.0f, -1.0f),
glm::vec3( 1.0f, -1.0f, -1.0f),
glm::vec3(-1.0f, -1.0f, -1.0f),
glm::vec3(-1.0f, 1.0f, 0.0f),
glm::vec3( 1.0f, 1.0f, 0.0f),
glm::vec3( 1.0f, -1.0f, 0.0f),
glm::vec3(-1.0f, -1.0f, 0.0f),
glm::vec3(-1.0f, 1.0f, 1.0f),
glm::vec3( 1.0f, 1.0f, 1.0f),
glm::vec3( 1.0f, -1.0f, 1.0f),