diff options
author | Tomi Korpipää <tomi.korpipaa@qt.io> | 2019-02-28 17:57:38 +0200 |
---|---|---|
committer | Tomi Korpipää <tomi.korpipaa@qt.io> | 2019-03-01 12:51:05 +0000 |
commit | 4b7897afeb1cd976d3df0ff295bfff7bccadb7ad (patch) | |
tree | befd215323979260ef9561db34d52a4573582180 | |
parent | c1890fedbae02c1d07f5a7721d98e71858d9011a (diff) |
Do not double the shadow draw distance
Keep the draw distance for the directional light shadow within
camera clip distance instead of doubling it.
Task-number: QT3DS-3118
Change-Id: Id7e7b5ffab9856729338ceb72ea366b7c04697e4
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r-- | src/runtime/q3dsscenemanager.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/runtime/q3dsscenemanager.cpp b/src/runtime/q3dsscenemanager.cpp index 2a57676..ab6f3d2 100644 --- a/src/runtime/q3dsscenemanager.cpp +++ b/src/runtime/q3dsscenemanager.cpp @@ -2929,8 +2929,8 @@ void Q3DSSceneManager::updateOrthoShadowCam(Q3DSLayerAttached::PerLightShadowMap maxDistanceX = distanceX; } - float clipNear = -qFabs(maxDistanceZ - minDistanceZ); - float clipFar = qFabs(maxDistanceZ - minDistanceZ); + float clipNear = -qFabs(maxDistanceZ - minDistanceZ) / 2; + float clipFar = qFabs(maxDistanceZ - minDistanceZ) / 2; d->shadowCamOrtho->setNearPlane(clipNear); d->shadowCamOrtho->setFarPlane(clipFar); |