From d405cf5b7c61aebf0e59040d09a997fe20281675 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 23 Jul 2016 09:47:14 +0200 Subject: [PATCH] - fixed: Before rendering a sector stack portal the clipper needs to be completely filled, if the view point's subsector is not inside the portal. If this is not done, some setups where a recursive look into the originating area is possible may exhibit some issues. --- src/gl/scene/gl_portal.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gl/scene/gl_portal.cpp b/src/gl/scene/gl_portal.cpp index 6082c6f4f4..b95e1fee0f 100644 --- a/src/gl/scene/gl_portal.cpp +++ b/src/gl/scene/gl_portal.cpp @@ -756,6 +756,15 @@ void GLSectorStackPortal::DrawContents() SaveMapSection(); SetupCoverage(); ClearClipper(); + + // If the viewpoint is not within the portal, we need to invalidate the entire clip area. + // The portal will re-validate the necessary parts when its subsectors get traversed. + subsector_t *sub = R_PointInSubsector(ViewPos); + if (!(gl_drawinfo->ss_renderflags[sub - ::subsectors] & SSRF_SEEN)) + { + clipper.SafeAddClipRange(0, ANGLE_MAX); + } + GLRenderer->DrawScene(DM_PORTAL); RestoreMapSection();