irrelevant comment updates.

This commit is contained in:
Shpoike 2021-03-18 12:33:44 +00:00
parent 425b3fb28b
commit 0b39f9daae
2 changed files with 5 additions and 3 deletions

View file

@ -484,7 +484,6 @@ void R_SetupGL (void)
int scale;
//johnfitz -- rewrote this section
glMatrixMode(GL_PROJECTION);
scale = CLAMP(1, (int)r_scale.value, 4); // ericw -- see R_ScaleView
glViewport (glx + r_refdef.vrect.x,
gly + glheight - r_refdef.vrect.y - r_refdef.vrect.height,
@ -492,10 +491,11 @@ void R_SetupGL (void)
r_refdef.vrect.height / scale);
//johnfitz
#if 1
#if 1 //Spike: these should be equivelent. gpus tend not to use doubles in favour of speed, so no loss there.
{
mat4_t mat;
Matrix4_ProjectionMatrix(r_fovx, r_fovy, NEARCLIP, gl_farclip.value, false, frustum_skew, 0, mat);
glMatrixMode(GL_PROJECTION);
glLoadMatrixf(mat);
Matrix4_ViewMatrix(r_refdef.viewangles, r_refdef.vieworg, mat);
@ -503,7 +503,8 @@ void R_SetupGL (void)
glLoadMatrixf(mat);
}
#else
//glLoadIdentity ();
glMatrixMode(GL_PROJECTION);
glLoadIdentity ();
GL_SetFrustum (r_fovx, r_fovy); //johnfitz -- use r_fov* vars
// glCullFace(GL_BACK); //johnfitz -- glquake used CCW with backwards culling -- let's do it right

View file

@ -856,6 +856,7 @@ void Matrix4_ProjectionMatrix(float fovx, float fovy, float neard, float fard, q
out[6] = 0;
if (fard < neard)
{ //fiddle with the far clip plane to make it rather large
//depth precision is non-linear, decaying with distance relative to the near clip plane, a closer near plane degrades precision faster, so an 'infinite' far clip plane doesn't actually hurt typical precision all that much, at least with a 24bit depth buffer.
const double epsilon = 1.0/(1<<22);
out[10] = epsilon-1;
out[14] = (epsilon-(df-dn))*neard;