Permalink
Browse files

OpenGL Renderer: Allow all opaque non-shadow polygons to write to the…

… depth buffer, making polygon opacity a priority state.

Fixes issue #13. (Regression from r5372.)
  • Loading branch information...
1 parent efcdd32 commit 49309fb053a98ba2f671e2ee0cbf7ab04e490704 @rogerman rogerman committed Dec 16, 2016
Showing with 3 additions and 3 deletions.
  1. +2 −2 desmume/src/OGLRender.cpp
  2. +1 −1 desmume/src/OGLRender_3_2.cpp
@@ -3026,7 +3026,7 @@ Render3DError OpenGLRenderer_1_2::SetupPolygon(const POLY &thePoly)
{
glDisable(GL_STENCIL_TEST);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
- enableDepthWrite = (!attr.isTranslucent || ( (attr.polygonMode == POLYGON_MODE_DECAL) && attr.isOpaque ) || attr.enableAlphaDepthWrite) ? GL_TRUE : GL_FALSE;
+ enableDepthWrite = (!attr.isTranslucent || attr.isOpaque || attr.enableAlphaDepthWrite) ? GL_TRUE : GL_FALSE;
}
else
{
@@ -4628,7 +4628,7 @@ Render3DError OpenGLRenderer_2_0::SetupPolygon(const POLY &thePoly)
{
glDisable(GL_STENCIL_TEST);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
- enableDepthWrite = (!attr.isTranslucent || ( (attr.polygonMode == POLYGON_MODE_DECAL) && attr.isOpaque ) || attr.enableAlphaDepthWrite) ? GL_TRUE : GL_FALSE;
+ enableDepthWrite = (!attr.isTranslucent || attr.isOpaque || attr.enableAlphaDepthWrite) ? GL_TRUE : GL_FALSE;
}
else
{
@@ -1669,7 +1669,7 @@ Render3DError OpenGLRenderer_3_2::SetupPolygon(const POLY &thePoly)
{
glDisable(GL_STENCIL_TEST);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
- enableDepthWrite = (!attr.isTranslucent || ( (attr.polygonMode == POLYGON_MODE_DECAL) && attr.isOpaque ) || attr.enableAlphaDepthWrite) ? GL_TRUE : GL_FALSE;
+ enableDepthWrite = (!attr.isTranslucent || attr.isOpaque || attr.enableAlphaDepthWrite) ? GL_TRUE : GL_FALSE;
}
else
{

1 comment on commit 49309fb

@tabnk
tabnk commented on 49309fb Dec 17, 2016

Nice. Thank. :)

OpenGL 3.2:
image

Please sign in to comment.