Non-transparent texture fullbright display fix

This commit is contained in:
Ryan Baldwin 2022-08-19 22:54:38 -07:00
parent 05d82bc901
commit f4528b18be
3 changed files with 6 additions and 1 deletions

Binary file not shown.

Binary file not shown.

View file

@ -1233,6 +1233,7 @@ void R_DrawBrushModel (entity_t *e)
//
// draw texture
//
int touched_transparent = 0; // naievil -- wow I cannot believe this works, fixes rendering on non transparent textures
for (i=0 ; i<clmodel->nummodelsurfaces ; i++, psurf++)
{
// find which side of the node we are on
@ -1240,6 +1241,10 @@ void R_DrawBrushModel (entity_t *e)
dot = DotProduct (modelorg, pplane->normal) - pplane->dist;
if (!strncmp(psurf->texinfo->texture->name,"{",1)) {
touched_transparent = 1;
}
// draw the polygon
if (((psurf->flags & SURF_PLANEBACK) && (dot < -BACKFACE_EPSILON)) ||
(!(psurf->flags & SURF_PLANEBACK) && (dot > BACKFACE_EPSILON)))
@ -1248,7 +1253,7 @@ void R_DrawBrushModel (entity_t *e)
}
}
R_BlendLightmaps (1);
R_BlendLightmaps (touched_transparent);
glPopMatrix ();
}