From 8e94926072c7eeaf80a42930492837d620813949 Mon Sep 17 00:00:00 2001 From: rogerman Date: Tue, 10 Oct 2017 17:43:43 -0700 Subject: [PATCH] OpenGL Renderer: Fix bug where translucent fragments drawing on top of zero-alpha fragments were not overwriting the destination fragment color as intended. (Regression from commit 2a1aaf7.) --- desmume/src/OGLRender.cpp | 2 +- desmume/src/OGLRender_3_2.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/desmume/src/OGLRender.cpp b/desmume/src/OGLRender.cpp index bb0115271..0c36b87b9 100755 --- a/desmume/src/OGLRender.cpp +++ b/desmume/src/OGLRender.cpp @@ -4290,7 +4290,7 @@ Render3DError OpenGLRenderer_1_2::SetupPolygon(const POLY &thePoly, bool treatAs { glStencilFunc(GL_ALWAYS, thePoly.attribute.PolygonID, 0x3F); glStencilOp(GL_KEEP, GL_KEEP, (treatAsTranslucent) ? GL_KEEP : GL_REPLACE); - glStencilMask(0x7F); // Drawing non-shadow polygons will implicitly reset the shadow volume mask. + glStencilMask(0xFF); // Drawing non-shadow polygons will implicitly reset the shadow volume mask. glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); glDepthMask((!treatAsTranslucent || thePoly.attribute.TranslucentDepthWrite_Enable) ? GL_TRUE : GL_FALSE); diff --git a/desmume/src/OGLRender_3_2.cpp b/desmume/src/OGLRender_3_2.cpp index 9c0c74d5d..652f40bd7 100644 --- a/desmume/src/OGLRender_3_2.cpp +++ b/desmume/src/OGLRender_3_2.cpp @@ -1914,7 +1914,7 @@ Render3DError OpenGLRenderer_3_2::SetupPolygon(const POLY &thePoly, bool treatAs { glStencilFunc(GL_ALWAYS, thePoly.attribute.PolygonID, 0x3F); glStencilOp(GL_KEEP, GL_KEEP, (treatAsTranslucent) ? GL_KEEP : GL_REPLACE); - glStencilMask(0x7F); // Drawing non-shadow polygons will implicitly reset the shadow volume mask. + glStencilMask(0xFF); // Drawing non-shadow polygons will implicitly reset the shadow volume mask. glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); glDepthMask((!treatAsTranslucent || thePoly.attribute.TranslucentDepthWrite_Enable) ? GL_TRUE : GL_FALSE);