From 161232582e7f7e7e6e991def2fe87d78e668d08f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomi=20Korpip=C3=A4=C3=A4?= Date: Wed, 8 May 2013 11:05:24 +0300 Subject: Shadow mapping implementation Partially works, but mostly doesn't. Change-Id: I415833d07148d2aeae64c0c311e14766ab29ad5e Reviewed-by: Miikka Heikkinen --- src/datavis3d/global/qdatavis3namespace.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/datavis3d/global/qdatavis3namespace.h') diff --git a/src/datavis3d/global/qdatavis3namespace.h b/src/datavis3d/global/qdatavis3namespace.h index 2177b175..a4ca7c42 100644 --- a/src/datavis3d/global/qdatavis3namespace.h +++ b/src/datavis3d/global/qdatavis3namespace.h @@ -50,8 +50,11 @@ QTCOMMERCIALDATAVIS3D_BEGIN_NAMESPACE // Constants used in several files const GLfloat m_pi = 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679f; -const GLfloat zComp = 10.0f; // Compensation for z position; move all objects to positive z, as shader can't handle negative values correctly -const QVector3D defaultLightPos = QVector3D(0.0f, 3.0f, zComp); +// Compensation for z position; move all objects to positive z, as shader can't handle negative values correctly +const GLfloat zComp = 10.0f; +// Default light position. To have shadows working correctly, light should be as far as camera, or a bit further +// y position is added to the minimum height (or can be thought to be that much above or below the camera) +const QVector3D defaultLightPos = QVector3D(0.0f, 0.5f, zComp); const GLfloat defaultRatio = 1.0f / 1.6f; // default aspect ratio 16:10 // Enums used in several files -- cgit v1.2.3