From f6481b2876bd8d18016aede6a870829b4ce52318 Mon Sep 17 00:00:00 2001 From: "Dileep V. Reddy" Date: Sun, 6 Jul 2025 15:05:20 -0600 Subject: [PATCH] Stacked-sector portal and reflective flat stencils rewrite to address rendering bug with stencil cap. --- src/rendering/hwrenderer/scene/hw_portal.cpp | 4 +-- src/rendering/hwrenderer/scene/hw_sky.cpp | 38 ++++++++++---------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/rendering/hwrenderer/scene/hw_portal.cpp b/src/rendering/hwrenderer/scene/hw_portal.cpp index 4d1ce3f8b..1cdc10857 100644 --- a/src/rendering/hwrenderer/scene/hw_portal.cpp +++ b/src/rendering/hwrenderer/scene/hw_portal.cpp @@ -839,7 +839,7 @@ bool HWSectorStackPortal::Setup(HWDrawInfo *di, FRenderState &rstate, Clipper *c void HWSectorStackPortal::DrawPortalStencil(FRenderState &state, int pass) { - if (mState->vpIsAllowedOoB) + if (true) // mState->vpIsAllowedOoB) { bool isceiling = planesused & (1 << sector_t::ceiling); for (unsigned i = 0; ivpIsAllowedOoB) + if (true) // mState->vpIsAllowedOoB) { bool isceiling = planesused & (1 << sector_t::ceiling); for (unsigned int i = 0; i < lines.Size(); i++) diff --git a/src/rendering/hwrenderer/scene/hw_sky.cpp b/src/rendering/hwrenderer/scene/hw_sky.cpp index 9ff480884..e8645e8dc 100644 --- a/src/rendering/hwrenderer/scene/hw_sky.cpp +++ b/src/rendering/hwrenderer/scene/hw_sky.cpp @@ -318,15 +318,16 @@ void HWWall::SkyTop(HWWallDispatcher *di, seg_t * seg,sector_t * fs,sector_t * b float frontreflect = fs->GetReflect(sector_t::ceiling); if (frontreflect > 0) { - float backreflect = bs->GetReflect(sector_t::ceiling); - if (backreflect > 0 && bs->ceilingplane.fD() == fs->ceilingplane.fD() && !bs->isClosed()) - { - // Don't add intra-portal line to the portal. - if (!(di->di && di->di->Viewpoint.IsAllowedOoB())) - { - return; - } - } + // [DVR] Changed the stencil for planemirrors, so now I need intra-portal lines + // float backreflect = bs->GetReflect(sector_t::ceiling); + // if (backreflect > 0 && bs->ceilingplane.fD() == fs->ceilingplane.fD() && !bs->isClosed()) + // { + // Don't add intra-portal line to the portal. + // if (!(di->di && di->di->Viewpoint.IsAllowedOoB())) + // { + // return; + // } + // } } else { @@ -400,15 +401,16 @@ void HWWall::SkyBottom(HWWallDispatcher *di, seg_t * seg,sector_t * fs,sector_t float frontreflect = fs->GetReflect(sector_t::floor); if (frontreflect > 0) { - float backreflect = bs->GetReflect(sector_t::floor); - if (backreflect > 0 && bs->floorplane.fD() == fs->floorplane.fD() && !bs->isClosed()) - { - // Don't add intra-portal line to the portal. - if (!(di->di && di->di->Viewpoint.IsAllowedOoB())) - { - return; - } - } + // [DVR] Changed the stencil for planemirrors, so now I need intra-portal lines + // float backreflect = bs->GetReflect(sector_t::floor); + // if (backreflect > 0 && bs->floorplane.fD() == fs->floorplane.fD() && !bs->isClosed()) + // { + // // Don't add intra-portal line to the portal. + // if (!(di->di && di->di->Viewpoint.IsAllowedOoB())) + // { + // return; + // } + // } } else {