Stacked-sector portal and reflective flat stencils rewrite to address rendering bug with stencil cap.

This commit is contained in:
Dileep V. Reddy 2025-07-06 15:05:20 -06:00 committed by Ricardo Luís Vaz Silva
commit f6481b2876
2 changed files with 22 additions and 20 deletions

View file

@ -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; i<subsectors.Size(); i++)
@ -920,7 +920,7 @@ bool HWPlaneMirrorPortal::Setup(HWDrawInfo *di, FRenderState &rstate, Clipper *c
void HWPlaneMirrorPortal::DrawPortalStencil(FRenderState &state, int pass)
{
if (mState->vpIsAllowedOoB)
if (true) // mState->vpIsAllowedOoB)
{
bool isceiling = planesused & (1 << sector_t::ceiling);
for (unsigned int i = 0; i < lines.Size(); i++)

View file

@ -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
{