From 633439b8c943def5f39a8be5b460733ba3c1fd07 Mon Sep 17 00:00:00 2001 From: tomaz Date: Sat, 18 Sep 2010 22:45:49 +0000 Subject: [PATCH] Fixed the x axis flipped shadows, 1 step closer to getting all this to work perfecty in d3d9 git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10476 d7cf8633-e32d-0410-b094-e92efae38249 --- r_shadow.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/r_shadow.c b/r_shadow.c index 45fe5c9f..a5005db3 100644 --- a/r_shadow.c +++ b/r_shadow.c @@ -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) { -- 2.39.2