Improve depth fighting by pushing out the near plane and improve near plane clipping by depth clamping.

Suggest reducing SCISDIST when there's time to debug SCISDIST issues.

git-svn-id: https://svn.eduke32.com/eduke32@7754 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
pogokeen 2019-07-05 21:17:54 +00:00 committed by Christoph Oelckers
parent 8de0fd35a1
commit c9014870e3

View file

@ -42,7 +42,9 @@ static int32_t yax_drawcf = -1;
static float dxb1[MAXWALLSB], dxb2[MAXWALLSB];
#define SCISDIST 1.0f //1.0: Close plane clipping distance
//POGOTODO: the SCISDIST could be set to 0 now to allow close objects to render properly,
// but there's a nasty rendering bug that needs to be dug into when setting SCISDIST lower than 1
#define SCISDIST 1.f //close plane clipping distance
#define SOFTROTMAT 0
@ -759,6 +761,9 @@ void polymost_glinit()
glPixelStorei(GL_PACK_ALIGNMENT, 1);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
if (glinfo.depthclamp)
glEnable(GL_DEPTH_CLAMP);
//glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
//glEnable(GL_LINE_SMOOTH);
@ -1393,7 +1398,7 @@ static void resizeglcheck(void)
float m[4][4];
Bmemset(m,0,sizeof(m));
float const nearclip = SCISDIST / (gxyaspect * gyxscale * 1024.f);
float const nearclip = 4.0f / (gxyaspect * gyxscale * 1024.f);
float const farclip = 64.f;
gloxyaspect = gxyaspect;