CompilePassBullets: Difference between revisions
Jump to navigation
Jump to search
Bug:Does not work correctly in some games (need to use separate %CompileClip brushes instead):
Confirm:A custom VBSP which applies CONTENTS_PLAYERCLIP and CONTENTS_MONSTERCLIP instead of CONTENTS_GRATE (without applying SURF_NODRAW and SURF_NOLIGHT, unlike %CompileClip) would probably function as intended in these games.
[todo tested in ?]
Confirm:Seems to act oddly in regards to casting lightmap shadows; see talk page.
SirYodaJedi (talk | contribs) No edit summary |
SirYodaJedi (talk | contribs) No edit summary |
||
Line 7: | Line 7: | ||
* Does not work in {{csgo}} and {{css}}. | * Does not work in {{csgo}} and {{css}}. | ||
* Only allows explosions through in {{tf2}} | * Only allows explosions through in {{tf2}} | ||
{{modernConfirm|A custom VBSP which applies CONTENTS_PLAYERCLIP and CONTENTS_MONSTERCLIP instead of CONTENTS_GRATE (without applying SURF_NODRAW and SURF_NOLIGHT, unlike [[%CompileClip]]) would probably function as intended in these games. | {{modernConfirm|A custom VBSP which applies [[CONTENTS_PLAYERCLIP]] and [[CONTENTS_MONSTERCLIP]] instead of [[CONTENTS_GRATE]] (without applying [[SURF_NODRAW]] and [[SURF_NOLIGHT]], unlike [[%CompileClip]]) would probably function as intended in these games. | ||
Example code: | Example code: | ||
<source lang=cpp> | <source lang=cpp> |
Revision as of 11:01, 1 May 2025
For models, see $contents grate.
Adding this VMT parameter to a material to make VBSP flag the brush contents as CONTENTS_GRATE, causing the brush to be non-solid to hitscan traces, such as bullets. Useful for foliage or metal grates.


Example code:
if ( ( propVal = GetMaterialVar( matID, "%compileClipYesDraw" ) ) && StringIsTrue( propVal ) )
{
// like %compilePassBullets, but works in CS:S and TF2
// NOTE: This has effects on visibility too!
textureref[i].contents &= ~CONTENTS_SOLID;
textureref[i].contents |= CONTENTS_PLAYERCLIP | CONTENTS_MONSTERCLIP;
}
