From 38ad6ce6b77d640d97fb670a2bef83f6f8cb9ab8 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 ed2c523f2..b784e74fd 100644 --- a/src/gl/renderer/gl_renderer.h +++ b/src/gl/renderer/gl_renderer.h @@ -79,7 +79,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 4cf8b9e7b..967f6b3fc 100644 --- a/src/gl/scene/gl_portal.cpp +++ b/src/gl/scene/gl_portal.cpp @@ -655,7 +655,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 a3c896b27..1e4b7ac58 100644 --- a/src/gl/scene/gl_scene.cpp +++ b/src/gl/scene/gl_scene.cpp @@ -491,7 +491,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--;