From f49c15fdeca834da29cbcb94620b4c9f79bf107f Mon Sep 17 00:00:00 2001 From: luigi__ Date: Tue, 13 Jan 2009 19:58:54 +0000 Subject: [PATCH] Commented out the "depth write for alpha poly" stuff as it causes glitches more than everything else. Changed the first depth func from GL_LESS to GL_LEQUAL, it fixes Z-fighting in some cases where the depth func is GL_LESS and two elements have the same depth. --- desmume/src/OGLRender.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/desmume/src/OGLRender.cpp b/desmume/src/OGLRender.cpp index a804ec43a..bc95d9c8c 100644 --- a/desmume/src/OGLRender.cpp +++ b/desmume/src/OGLRender.cpp @@ -210,7 +210,7 @@ static ALIGN(16) u8 GPU_screen3D [256*192*4]; static const unsigned short map3d_cull[4] = {GL_FRONT_AND_BACK, GL_FRONT, GL_BACK, 0}; static const int texEnv[4] = { GL_MODULATE, GL_DECAL, GL_MODULATE, GL_MODULATE }; -static const int depthFunc[2] = { GL_LESS, GL_EQUAL }; +static const int depthFunc[2] = { /*GL_LESS*/GL_LEQUAL, GL_EQUAL }; static bool needRefreshFramebuffer = false; static unsigned char texMAP[1024*2048*4]; static unsigned int textureMode=TEXMODE_NONE; @@ -1133,8 +1133,8 @@ static void BeginRenderPoly() setTexture(textureFormat, texturePalette); - if(isTranslucent) - enableDepthWrite = alphaDepthWrite; +// if(isTranslucent) +// enableDepthWrite = alphaDepthWrite; //handle shadow polys if(envMode == 3)