From 8d1a2c39f4ccebeeb049926b8d8282b73507df57 Mon Sep 17 00:00:00 2001 From: "Dileep V. Reddy" Date: Sun, 6 Jul 2025 17:00:04 -0600 Subject: [PATCH] Squashing a non-visual rendering bug in stacked sector portals and reflective flats. --- src/rendering/hwrenderer/scene/hw_flats.cpp | 4 +-- src/rendering/hwrenderer/scene/hw_portal.cpp | 4 +-- src/rendering/hwrenderer/scene/hw_sky.cpp | 38 ++++++++++---------- 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/src/rendering/hwrenderer/scene/hw_flats.cpp b/src/rendering/hwrenderer/scene/hw_flats.cpp index 7bd658032..be585199b 100644 --- a/src/rendering/hwrenderer/scene/hw_flats.cpp +++ b/src/rendering/hwrenderer/scene/hw_flats.cpp @@ -385,14 +385,14 @@ void HWFlat::DrawFlat(HWFlatDispatcher *di, FRenderState &state, bool translucen else state.AlphaFunc(Alpha_GEqual, 0.f); state.SetMaterial(texture, UF_Texture, 0, CLAMP_NONE, NO_TRANSLATION, -1); bool texmatrix = SetPlaneTextureRotation(state, &plane, texture); - if (di->di && di->di->Viewpoint.IsAllowedOoB()) + if (di->di) // dpjudas, gl_levelmesh could use zshift for reflective flats. - [DVR] { di->di->VPUniforms.mViewMatrix.translate(0.0, zshift, 0.0); di->di->vpIndex = state.SetViewpoint(di->di->VPUniforms); // screen->mViewpoints->SetViewpoint(state, &di->di->VPUniforms); } DrawSubsectors(di, state); - if (di->di && di->di->Viewpoint.IsAllowedOoB()) + if (di->di) { di->di->VPUniforms.mViewMatrix.translate(0.0, -zshift, 0.0); di->di->vpIndex = state.SetViewpoint(di->di->VPUniforms); diff --git a/src/rendering/hwrenderer/scene/hw_portal.cpp b/src/rendering/hwrenderer/scene/hw_portal.cpp index 698fa432e..c2dbf827a 100644 --- a/src/rendering/hwrenderer/scene/hw_portal.cpp +++ b/src/rendering/hwrenderer/scene/hw_portal.cpp @@ -835,7 +835,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 1e37d55d1..a5e4f23a7 100644 --- a/src/rendering/hwrenderer/scene/hw_sky.cpp +++ b/src/rendering/hwrenderer/scene/hw_sky.cpp @@ -315,15 +315,16 @@ void HWWall::SkyTop(HWWallDispatcher *di, FRenderState& state, seg_t * seg,secto 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 { @@ -397,15 +398,16 @@ void HWWall::SkyBottom(HWWallDispatcher *di, FRenderState& state, seg_t * seg,se 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 {