Add the area portal filter for idTech2 games.

These games had area portals. Quetoo now uses this contents for hardware occlusion queries as well -- so the filter is still useful there.
This commit is contained in:
Jay Dolan 2020-12-28 16:02:05 -05:00
parent 112e118de1
commit 655d74532d
2 changed files with 11 additions and 0 deletions

View file

@ -146,6 +146,7 @@ bfilter_t *FilterAddBase( bfilter_t *pFilter ){
pFilter = FilterAddImpl( pFilter,8,0,NULL,EXCLUDE_MIST,true );
pFilter = FilterAddImpl( pFilter,8,0,NULL,EXCLUDE_HINTSSKIPS,true );
pFilter = FilterAddImpl( pFilter,8,0,NULL,EXCLUDE_TRANSLUCENT,true );
pFilter = FilterAddImpl( pFilter,8,0,NULL,EXCLUDE_AREAPORTALS,true );
pFilter = FilterAddImpl( pFilter,8,0,NULL,EXCLUDE_SKY,true );
pFilter = FilterAddImpl( pFilter,3,0,"trigger",EXCLUDE_TRIGGERS,true );
pFilter = FilterAddImpl( pFilter,4,ECLASS_LIGHT,NULL,EXCLUDE_LIGHTS,true );
@ -308,6 +309,14 @@ bool FilterBrush( brush_t *pb ){
filterbrush = true;
}
break;
case EXCLUDE_AREAPORTALS:
if ( f->texdef.contents & CONTENTS_AREAPORTAL ) {
filterbrush = true;
}
if (strstr( f->pShader->getName(), "common/occlude" ) ) {
filterbrush = true;
}
break;
case EXCLUDE_TRANSLUCENT:
if ( f->texdef.contents & CONTENTS_WINDOW ) {
filterbrush = true;

View file

@ -362,6 +362,8 @@ typedef struct
#define CONTENTS_MIST 64
#define LAST_VISIBLE_CONTENTS 64
#define CONTENTS_AREAPORTAL 0x8000
// remaining contents are non-visible, and don't eat brushes
#define CONTENTS_PLAYERCLIP 0x10000
#define CONTENTS_MONSTERCLIP 0x20000