CompilePassBullets: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (SirYodaJedi moved page %compilepassbullets to %CompilePassBullets)
m (Setting bug notice hidetested=1 param on page where the bug might not need tested in param specified)
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{stub}}
{{subpage|[[Material map compile flags]]}}
Add this [[VMT]] parameter to a material to make [[VBSP]] flag the brush as non-solid to bullets. Useful for foliage or metal grates.
{{stub}}{{DISPLAYTITLE:%CompilePassBullets}}
{{for|models|{{cmd|$contents|grate}}}}
Adding this [[VMT]] parameter to a material to make [[VBSP]] flag the brush contents as {{code|[[CONTENTS_GRATE]]}}, causing the brush to be non-solid to hitscan traces, such as bullets. Useful for foliage or metal grates.


{{note|Only allows explosions through in {{tf2}}.}}
{{bug|hidetested=1|Does not work correctly in some games (need to use separate [[%CompileClip]] brushes instead):
{{bug|Does not work in {{csgo}} and {{css}}.}}
* Does not work in {{csgo}} and {{css}}.
* 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.
Example code:
<source lang=cpp>
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;
}
</source>}}
}}
{{confirm|Seems to act oddly in regards to casting lightmap shadows; see [[Talk:%CompilePassBullets|talk page]].}}


[[Category:List of Shader Parameters]]
[[Category:Shader parameters]]

Latest revision as of 07:15, 20 May 2025

Stub

This article or section is a stub. You can help by expanding it.

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.

Icon-Bug.pngBug:Does not work correctly in some games (need to use separate %CompileClip brushes instead):
  • Does not work in Counter-Strike: Global Offensive and Counter-Strike: Source.
  • Only allows explosions through in Team Fortress 2
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.

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;
}
Confirm:Seems to act oddly in regards to casting lightmap shadows; see talk page.