mirror of
https://github.com/overte-org/overte.git
synced 2025-08-15 08:32:25 +02:00
Fix shadowMap vertical keylight edge case
This commit is contained in:
parent
398f83be3f
commit
387a14b6b1
1 changed files with 2 additions and 0 deletions
|
@ -28,6 +28,8 @@ void LightStage::Shadow::setKeylightFrustum(ViewFrustum* viewFrustum, float near
|
|||
glm::quat orientation;
|
||||
if (direction == IDENTITY_UP) {
|
||||
orientation = glm::quat(glm::mat3(IDENTITY_RIGHT, IDENTITY_UP, IDENTITY_FRONT));
|
||||
} else if (direction == -IDENTITY_UP) {
|
||||
orientation = glm::quat(glm::mat3(-IDENTITY_RIGHT, -IDENTITY_UP, IDENTITY_FRONT));
|
||||
} else {
|
||||
auto side = glm::normalize(glm::cross(direction, IDENTITY_UP));
|
||||
auto up = glm::normalize(glm::cross(side, direction));
|
||||
|
|
Loading…
Reference in a new issue