summaryrefslogtreecommitdiffstats
path: root/src/datavis3d/engine/bars3drenderer.cpp
diff options
context:
space:
mode:
authorTomi Korpipää <tomi.korpipaa@digia.com>2013-08-14 11:17:49 +0300
committerTomi Korpipää <tomi.korpipaa@digia.com>2013-08-14 11:21:23 +0300
commit36a1a28f4adf3b7a937d7d5501511adffec398ab (patch)
tree37f9675890897b0c6da3177c1726ab6e04a51488 /src/datavis3d/engine/bars3drenderer.cpp
parent18785c5e4a02d7c9da2f3f469c7aca6fbe644f10 (diff)
Q3DBars: Shadow fix
Task-number: QTRD-2191 Fixed the issue with shadows appearing "through the floor" Change-Id: I214bcc4e393549d42e7b118be5e2848ab68b506c Change-Id: I214bcc4e393549d42e7b118be5e2848ab68b506c Reviewed-by: Mika Salmela <mika.salmela@digia.com>
Diffstat (limited to 'src/datavis3d/engine/bars3drenderer.cpp')
-rw-r--r--src/datavis3d/engine/bars3drenderer.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/datavis3d/engine/bars3drenderer.cpp b/src/datavis3d/engine/bars3drenderer.cpp
index 33874050..930cb9f5 100644
--- a/src/datavis3d/engine/bars3drenderer.cpp
+++ b/src/datavis3d/engine/bars3drenderer.cpp
@@ -589,7 +589,9 @@ void Bars3dRenderer::drawScene(CameraHelper *camera,
// Get the depth view matrix
// It may be possible to hack lightPos here if we want to make some tweaks to shadow
- depthViewMatrix.lookAt(lightPos, QVector3D(0.0f, -m_yAdjustment, zComp),
+ QVector3D depthLightPos = lightPos;
+ depthLightPos.setY(lightPos.y() - 0.5f);
+ depthViewMatrix.lookAt(depthLightPos, QVector3D(0.0f, -m_yAdjustment, zComp),
QVector3D(0.0f, 1.0f, 0.0f));
// TODO: Why does depthViewMatrix.column(3).y() goes to zero when we're directly above? That causes the scene to be not drawn from above -> must be fixed
//qDebug() << lightPos << depthViewMatrix << depthViewMatrix.column(3);