From 0d36c08c2d3ac71eb7fb307307ae6d0c5f32c0d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Fri, 21 Feb 2014 06:54:20 +0200 Subject: Fixed surface shadow wrong direction bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTRD-2887 Change-Id: I37938a86fe4b414cd969fda819d096dc885fa48f Change-Id: I37938a86fe4b414cd969fda819d096dc885fa48f Reviewed-by: Tomi Korpipää --- src/datavisualization/engine/surface3drenderer.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/datavisualization/engine/surface3drenderer.cpp b/src/datavisualization/engine/surface3drenderer.cpp index f4b35803..492f4174 100644 --- a/src/datavisualization/engine/surface3drenderer.cpp +++ b/src/datavisualization/engine/surface3drenderer.cpp @@ -1082,20 +1082,12 @@ void Surface3DRenderer::drawScene(GLuint defaultFboHandle) // Get the depth view matrix // It may be possible to hack lightPos here if we want to make some tweaks to shadow QVector3D depthLightPos = activeCamera->d_ptr->calculatePositionRelativeToCamera( - zeroVector, 0.0f, 3.5f / m_autoScaleAdjustment); + zeroVector, 0.0f, 4.0f / m_autoScaleAdjustment); depthViewMatrix.lookAt(depthLightPos, zeroVector, upVector); // Set the depth projection matrix -#ifndef USE_WIDER_SHADOWS - // Use this for perspective shadows depthProjectionMatrix.perspective(10.0f, (GLfloat)m_primarySubViewport.width() / (GLfloat)m_primarySubViewport.height(), 3.0f, 100.0f); -#else - // Use these for orthographic shadows - depthProjectionMatrix.ortho(-2.0f * 2.0f, 2.0f * 2.0f, - -2.0f, 2.0f, - 0.0f, 100.0f); -#endif depthProjectionViewMatrix = depthProjectionMatrix * depthViewMatrix; glDisable(GL_CULL_FACE); -- cgit v1.2.3