renders: skip SURF_NODRAW surfaces

Cheked with remaster psx/base0 map
This commit is contained in:
Denis Pauk 2024-11-10 22:26:12 +02:00
parent 6fd9e0ecc4
commit c3638d6c9a
6 changed files with 30 additions and 2 deletions

View file

@ -1090,6 +1090,11 @@ R_RecursiveWorldNode(entity_t *currententity, mnode_t *node)
r_alpha_surfaces = surf;
r_alpha_surfaces->texinfo->image = R_TextureAnimation(currententity, surf->texinfo);
}
else if (surf->texinfo->flags & SURF_NODRAW)
{
/* Surface should be skipped */
continue;
}
else
{
/* the polygon is visible, so add it to the texture sorted chain */

View file

@ -729,6 +729,11 @@ RecursiveWorldNode(entity_t *currententity, mnode_t *node)
gl3_alpha_surfaces = surf;
gl3_alpha_surfaces->texinfo->image = R_TextureAnimation(currententity, surf->texinfo);
}
else if (surf->texinfo->flags & SURF_NODRAW)
{
/* Surface should be skipped */
continue;
}
else
{
// calling RenderLightmappedPoly() here probably isn't optimal, rendering everything

View file

@ -726,6 +726,11 @@ RecursiveWorldNode(entity_t *currententity, mnode_t *node)
gl4_alpha_surfaces = surf;
gl4_alpha_surfaces->texinfo->image = R_TextureAnimation(currententity, surf->texinfo);
}
else if (surf->texinfo->flags & SURF_NODRAW)
{
/* Surface should be skipped */
continue;
}
else
{
// calling RenderLightmappedPoly() here probably isn't optimal, rendering everything

View file

@ -322,7 +322,7 @@ R_DrawSolidClippedSubmodelPolygons(entity_t *currententity, const model_t *curre
numsurfaces = currentmodel->nummodelsurfaces;
pedges = currentmodel->edges;
for (i=0 ; i<numsurfaces ; i++, psurf++)
for (i = 0; i < numsurfaces; i++, psurf++)
{
cplane_t *pplane;
bedge_t *pbedge;
@ -337,7 +337,9 @@ R_DrawSolidClippedSubmodelPolygons(entity_t *currententity, const model_t *curre
// draw the polygon
if (( !(psurf->flags & SURF_PLANEBACK) && (dot < -BACKFACE_EPSILON)) ||
((psurf->flags & SURF_PLANEBACK) && (dot > BACKFACE_EPSILON)))
{
continue;
}
// FIXME: use bounding-box-based frustum clipping info?
@ -349,7 +351,7 @@ R_DrawSolidClippedSubmodelPolygons(entity_t *currententity, const model_t *curre
pbedge = &bedges[numbedges];
numbedges += psurf->numedges;
for (j=0 ; j<psurf->numedges ; j++)
for (j = 0; j < psurf->numedges; j++)
{
int lindex;

View file

@ -536,6 +536,12 @@ R_RenderFace (entity_t *currententity, const model_t *currentmodel, msurface_t *
return;
}
if (fa->texinfo->flags & SURF_NODRAW)
{
/* Surface should be skipped */
return;
}
// sky surfaces encountered in the world will cause the
// environment box surfaces to be emited
if ( fa->texinfo->flags & SURF_SKY )

View file

@ -740,6 +740,11 @@ R_RecursiveWorldNode(entity_t *currententity, mnode_t *node)
surf->texturechain = r_alpha_surfaces;
r_alpha_surfaces = surf;
}
else if (surf->texinfo->flags & SURF_NODRAW)
{
/* Surface should be skipped */
continue;
}
else
{
if (!(surf->flags & SURF_DRAWTURB) && !r_showtris->value)