]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
UNMERGE
authorhavoc havoc@d7cf8633-e32d-0410-b094-e92efae38249 <>
Thu, 15 Jul 2010 12:39:14 +0000 (12:39 +0000)
committerRudolf Polzer <divverent@alientrap.org>
Fri, 24 Sep 2010 20:00:37 +0000 (22:00 +0200)
fix r_shadows 2 shadowmapping by rendering to the correct depth range in
GL again

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10331 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::unmerge=1212b6bbf6264e63229f0c4fcdca7cade6065a6e

gl_backend.c

index 4e5700b88bee1aa75d65f1742861a59feeb67419..58f6685005c84735c5d25e869dc097d29d3bd0f2 100644 (file)
@@ -515,25 +515,13 @@ void R_Viewport_InitOrtho(r_viewport_t *v, const matrix4x4_t *cameramatrix, int
        memset(m, 0, sizeof(m));
        m[0]  = 2/(right - left);
        m[5]  = 2/(top - bottom);
-       m[10] = -2/(zFar - zNear);
+//     m[10] = -2/(zFar - zNear);
+       m[10] = -1/(zFar - zNear);
        m[12] = - (right + left)/(right - left);
        m[13] = - (top + bottom)/(top - bottom);
-       m[14] = - (zFar + zNear)/(zFar - zNear);
+//     m[14] = - (zFar + zNear)/(zFar - zNear);
+       m[14] = -zNear/(zFar-zNear);
        m[15] = 1;
-       switch(vid.renderpath)
-       {
-       case RENDERPATH_GL11:
-       case RENDERPATH_GL13:
-       case RENDERPATH_GL20:
-       case RENDERPATH_CGGL:
-               break;
-       case RENDERPATH_D3D9:
-       case RENDERPATH_D3D10:
-       case RENDERPATH_D3D11:
-               m[10] = -1/(zFar - zNear);
-               m[14] = -zNear/(zFar-zNear);
-               break;
-       }
        v->screentodepth[0] = -farclip / (farclip - nearclip);
        v->screentodepth[1] = farclip * nearclip / (farclip - nearclip);