fixed the D3D projection transform not matching GL

This commit is contained in:
myT 2022-10-18 19:09:14 +02:00
parent 1b74aed8b9
commit 74acd92d91
2 changed files with 9 additions and 2 deletions

View File

@ -70,6 +70,8 @@ chg: with r_backend GL3, depth fade with MSAA now requires GLSL 4.00 at a minimu
chg: with r_backend GL3, alpha to coverage now requires GLSL 4.00 at a minimum
fix: the Direct3D projection transform didn't perfectly match the OpenGL version
fix: /video was writing incorrect audio stream lengths to the .avi file headers
fix: /systeminfo /serverinfo /clientinfo /dumpuser would crash when tokens were too long

View File

@ -438,8 +438,13 @@ static void R_SetupProjection()
tr.viewParms.projectionMatrix[2] = 0;
tr.viewParms.projectionMatrix[6] = 0;
tr.viewParms.projectionMatrix[10] = -( zFar + zNear ) / depth;
tr.viewParms.projectionMatrix[14] = -2 * zFar * zNear / depth;
if ( gal.id == GAL_D3D11 ) {
tr.viewParms.projectionMatrix[10] = -zFar / depth;
tr.viewParms.projectionMatrix[14] = -zFar * zNear / depth;
} else {
tr.viewParms.projectionMatrix[10] = -( zFar + zNear ) / depth;
tr.viewParms.projectionMatrix[14] = -2 * zFar * zNear / depth;
}
tr.viewParms.projectionMatrix[3] = 0;
tr.viewParms.projectionMatrix[7] = 0;