fix opengl portals (and its contents) being culled in some cases they shouldnt be
we do culling per our viewmatrix since a while, which wasnt properly set up for portals beforehand and used whatever was last which was then incorrectly applied to portal culling :chaobaba:
This commit is contained in:
1 parent
57e3a9eeb3
commit
fcb2bf97e2
2 files changed
+11
-7
No files matched your search
@@ -5456,10 +5456,14 @@ void HWR_RenderViewpoint(gl_portal_t *rootportal, player_t *player, int stencil_
|
||||
currentportallist = &portallist;
|
||||
HWR_SetPortalState(GLPORTAL_SEARCH);
|
||||
|
||||
HWR_ClearClipper();
|
||||
HWR_SetTransform(fpov);
|
||||
|
||||
HWR_ClearSprites();
|
||||
HWR_ClearClipper();
|
||||
if (rootportal)
|
||||
{
|
||||
HWR_PortalClipping(rootportal);
|
||||
}
|
||||
|
||||
validcount++;
|
||||
|
||||
@@ -5477,14 +5481,14 @@ void HWR_RenderViewpoint(gl_portal_t *rootportal, player_t *player, int stencil_
|
||||
}
|
||||
}
|
||||
|
||||
// draw normal things in current frame in current incremented stencil buffer area
|
||||
HWR_SetStencilState(HWR_STENCIL_NORMAL, stencil_level);
|
||||
|
||||
HWR_SetTransform(fpov);
|
||||
|
||||
HWR_ClearSprites();
|
||||
HWR_ClearClipper();
|
||||
|
||||
// draw normal things in current frame in current incremented stencil buffer area
|
||||
HWR_SetStencilState(HWR_STENCIL_NORMAL, stencil_level);
|
||||
|
||||
if constexpr (Type == RenderViewpointType::kPortal)
|
||||
{
|
||||
if (allow_portals && rootportal)
|
||||
|
||||
@@ -38,7 +38,7 @@ void HWR_PortalClipping(gl_portal_t *portal)
|
||||
gld_clipper_SafeAddClipRange(portal->angle1, portal->angle2);
|
||||
}
|
||||
|
||||
static gl_portal_t* HWR_Portal_Add (seg_t *seg)
|
||||
static gl_portal_t* HWR_Portal_Add(seg_t *seg)
|
||||
{
|
||||
gl_portal_t *portal = Z_Malloc(sizeof(gl_portal_t), PU_STATIC, NULL);
|
||||
|
||||
@@ -120,8 +120,8 @@ void HWR_PortalFrame(gl_portal_t* portal)
|
||||
viewz = portal->viewz;
|
||||
|
||||
viewangle = portal->viewangle;
|
||||
//viewsin = FINESINE(viewangle>>ANGLETOFINESHIFT);
|
||||
//viewcos = FINECOSINE(viewangle>>ANGLETOFINESHIFT);
|
||||
viewsin = FINESINE(viewangle>>ANGLETOFINESHIFT);
|
||||
viewcos = FINECOSINE(viewangle>>ANGLETOFINESHIFT);
|
||||
|
||||
if (portal->clipline != -1)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user