aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArisotura <thetotalworm@gmail.com>2019-06-09 19:53:28 +0200
committerArisotura <thetotalworm@gmail.com>2019-06-09 19:53:28 +0200
commitc056dfe509f5c28fa934320007e57278a887305f (patch)
treedbc512f26fe7562a0019cb4236048eec97099578
parent086354a42014488e8b97d71d7ed2bf7649ab33ed (diff)
fix fog alpha
-rw-r--r--src/GPU3D_OpenGL.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/GPU3D_OpenGL.cpp b/src/GPU3D_OpenGL.cpp
index b334ffc..6aaaaec 100644
--- a/src/GPU3D_OpenGL.cpp
+++ b/src/GPU3D_OpenGL.cpp
@@ -735,6 +735,8 @@ void RenderSceneChunk(int y, int h)
}
glEnable(GL_BLEND);
+ glBlendEquationSeparate(GL_FUNC_ADD, GL_MAX);
+
if (RenderDispCnt & (1<<3))
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ONE, GL_ONE);
else
@@ -923,6 +925,9 @@ void RenderSceneChunk(int y, int h)
glColorMaski(0, GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glColorMaski(1, GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
+ glEnable(GL_BLEND);
+ glBlendEquationSeparate(GL_FUNC_ADD, GL_FUNC_ADD);
+
glDepthFunc(GL_ALWAYS);
glDepthMask(GL_FALSE);
glStencilFunc(GL_ALWAYS, 0, 0);
@@ -944,7 +949,6 @@ void RenderSceneChunk(int y, int h)
glUseProgram(FinalPassEdgeShader[2]);
- glEnable(GL_BLEND);
glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_ZERO, GL_ONE);
glDrawArrays(GL_TRIANGLES, 0, 2*3);
@@ -956,7 +960,6 @@ void RenderSceneChunk(int y, int h)
glUseProgram(FinalPassFogShader[2]);
- glEnable(GL_BLEND);
if (RenderDispCnt & (1<<6))
glBlendFuncSeparate(GL_ZERO, GL_ONE, GL_CONSTANT_COLOR, GL_ONE_MINUS_SRC_ALPHA);
else