From c79051126e23345700e65c20d87b2e0d06b2818e Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Sat, 11 Mar 2017 17:20:06 +0100 Subject: [PATCH] Fix ssao being applied to skybox portals --- src/gl/renderer/gl_renderer.h | 3 ++- src/gl/scene/gl_portal.cpp | 2 +- src/gl/scene/gl_scene.cpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gl/renderer/gl_renderer.h b/src/gl/renderer/gl_renderer.h index ed98ffe2bf..4d88832055 100644 --- a/src/gl/renderer/gl_renderer.h +++ b/src/gl/renderer/gl_renderer.h @@ -81,7 +81,8 @@ enum { DM_MAINVIEW, DM_OFFSCREEN, - DM_PORTAL + DM_PORTAL, + DM_SKYPORTAL }; class FGLRenderer diff --git a/src/gl/scene/gl_portal.cpp b/src/gl/scene/gl_portal.cpp index ed8993df83..a430253346 100644 --- a/src/gl/scene/gl_portal.cpp +++ b/src/gl/scene/gl_portal.cpp @@ -659,7 +659,7 @@ void GLSkyboxPortal::DrawContents() SaveMapSection(); currentmapsection[mapsection >> 3] |= 1 << (mapsection & 7); - GLRenderer->DrawScene(DM_PORTAL); + GLRenderer->DrawScene(DM_SKYPORTAL); portal->mFlags &= ~PORTSF_INSKYBOX; inskybox = false; gl_RenderState.SetDepthClamp(oldclamp); diff --git a/src/gl/scene/gl_scene.cpp b/src/gl/scene/gl_scene.cpp index 2dcb8e7642..198cb4fbdf 100644 --- a/src/gl/scene/gl_scene.cpp +++ b/src/gl/scene/gl_scene.cpp @@ -495,7 +495,7 @@ void FGLRenderer::DrawScene(int drawmode) { ssao_portals_available = 0; } - else if (ssao_portals_available > 0) + else if (drawmode == DM_PORTAL && ssao_portals_available > 0) { applySSAO = true; ssao_portals_available--;