]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
Fixed the x axis flipped shadows, 1 step closer to getting all this to work perfecty...
authortomaz <tomaz@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 18 Sep 2010 22:45:49 +0000 (22:45 +0000)
committertomaz <tomaz@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 18 Sep 2010 22:45:49 +0000 (22:45 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10476 d7cf8633-e32d-0410-b094-e92efae38249

r_shadow.c

index 45fe5c9f3ede0f85553c352cc7112cd5bf7d83b8..a5005db3c28ce1a8e5d67ffe54892d70951cde96 100644 (file)
@@ -4366,6 +4366,25 @@ void R_DrawModelShadowMaps(void)
        Matrix4x4_Concat(&texmatrix, &scalematrix, &shadowmatrix);
        Matrix4x4_Concat(&r_shadow_shadowmapmatrix, &texmatrix, &invmvpmatrix);
 
+       switch (vid.renderpath)
+       {
+               case RENDERPATH_D3D9:
+               case RENDERPATH_D3D10:
+               case RENDERPATH_D3D11:
+#ifdef OPENGL_ORIENTATION
+               r_shadow_shadowmapmatrix.m[0][0]        *= -1.0f;
+               r_shadow_shadowmapmatrix.m[0][1]        *= -1.0f;
+               r_shadow_shadowmapmatrix.m[0][2]        *= -1.0f;
+               r_shadow_shadowmapmatrix.m[0][3]        *= -1.0f;
+#else
+               r_shadow_shadowmapmatrix.m[0][0]        *= -1.0f;
+               r_shadow_shadowmapmatrix.m[1][0]        *= -1.0f;
+               r_shadow_shadowmapmatrix.m[2][0]        *= -1.0f;
+               r_shadow_shadowmapmatrix.m[3][0]        *= -1.0f;
+#endif
+               break;
+       }
+
        r_shadow_usingshadowmaportho = true;
        switch (r_shadow_shadowmode)
        {