Material map compile flags: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(csgo doesnt have npcs)
 
(104 intermediate revisions by 14 users not shown)
Line 1: Line 1:
Several special shader parameters exist, starting with a <code>%</code> sign instead of <code>$</code>. These are read by the compile tools to alter the properties of the face or the brush they are attached to. Most are intended to produce the special <code>tools/</code> textures, but may also be used for other materials. All are boolean properties. These cannot be affected by [[Material_Proxies|Proxies]].
{{lang|{{PAGENAME}}}}
Several special [[:Category:List of Shader Parameters|shader parameters]] exist that start with a <code>%</code> sign instead of <tt>$</tt>. These are read by the compile tools to alter the properties of the face or the brush they are attached to. Most are intended to produce the special <code>tools/</code> textures, but they may also be used for other materials.<br>
Most flags are [[boolean]] properties, except where specified.


See also [[Tool_textures|Tool Textures]] for more detail about the propeties of individual materials.
See also [[Tool textures|Tool Textures]] for more detail about the propeties of individual materials.


Example:
{{ModernExample|{{pre|
LightmappedGeneric
{
$basetexture developer/custom_clip
  '''%compileclip 1'''
}
}}}}
{{note|As with shader parameters, the names of compile flags are '''not''' case sensitive: <tt>%compileclip 1</tt> and <tt>%CompileClip 1</tt> deliver the same result.}}
{{note|These flags are associated with contents and surface flags which are stored in the BSP can can be stored in the VMF; see [[BSP flags (Source)]] for more information.}}
{{todo|DeathByNuke's [[VBSP]] has {{cmd|%CompileChopLow}}, {{cmd|%CompileChopHigh}}, and {{cmd|%CompileChopAll}}, which affect how brush faces are spilt when touching other brush faces; document these.}}
{{Todo|Separate page that documents Source 2's [[VMAT]] attributes, which is successor to compile flags.}}


LightmappedGeneric
{
$basetexture developer/custom_clip
'''%compileclip 1'''
}
== Exclusive Flags ==
== Exclusive Flags ==
Only one of these flags may be set on any given material.
'''Only one''' of the following flags may be set on any given material.<br>
 
Every flag is available in all Source Engine branches, unless specifically mentioned in the <code>Availability</code> box<br>
==== %CompileClip (<code>toolsclip</code>) ====
====Clips====
[[image:Toolsclip.gif|32px]] Makes the brush block only players and NPCs. This is equivalent to a combination of '''PlayerClip''' and '''NPCClip'''.
{| class="standard-table"
 
! VMT flag
=== %CompileNoChop ===
! [[BSP flags]] assigned
Prevents 'subdividing patches' on the surface. This presumably affects how the face is converted to triangles.
! Seen in VMT(s)
 
! Availability
=== %CompileNPCClip (<code>toolsnpcclip</code>) ===
! Description
[[image:Toolsnpcclip.gif|32px]] Makes the brush block only NPCs. This implies '''NoLight''' and '''NoDraw'''.
|- id="%CompileClip"
 
| [[%CompileClip]]
=== %CompileOrigin (<code>toolsorigin</code>) ===
| CONTENTS_PLAYERCLIP<br>CONTENTS_MONSTERCLIP<br>SURF_NODRAW<br>SURF_NOLIGHT<br><span style="color:#f66">removes&nbsp;SURF_BUMPLIGHT</span>
[[image:Toolsorigin.gif|32px]] Sets the origin of a brush entity. This is deprecated for Source maps, in GoldSource origin brushes were used to set the rotation origin of rotating entities.
| toolsclip
 
|
=== %CompileTrigger (<code>toolstrigger</code>) ===
| Makes the brush block only [[player]]s and [[NPC]]s. This is equivalent to a combination of <tt>%PlayerClip</tt> and <tt>%CompileNPCClip</tt>.
[[image:Toolstrigger.gif|32px]] Makes the brush suitable for [[Trigger|Triggers]].
|- id="%CompileNPCClip"
 
| [[%CompileNPCClip]]
=== %CompileSkip(toolsskip) ===
| CONTENTS_MONSTERCLIP<br>SURF_NODRAW<br>SURF_NOLIGHT<br><span style="color:#f66">removes&nbsp;SURF_BUMPLIGHT</span>
[[image:Toolsskip.gif|32px]] Removes the face during compilation, making the brush into sets of planes.
| toolsnpcclip
 
|
=== %CompileSky (toolsskybox) ===
| Makes the brush block only [[NPC]]s. This implies <tt>NoLight</tt> and </tt>NoDraw</tt>.<br>{{note|{{csgo}} Blocks [[bot]]s, even though they are [[player]]s.}}
[[image:Toolsskybox.gif|32px]] Makes the face render the (2D/3D) [[Skybox]], and emit [[light_environment]] light.
|- id="%PlayerClip"
 
| [[%PlayerClip]]
=== %Compile2DSky (toolsskybox2d) ===
| CONTENTS_PLAYERCLIP<br>SURF_NODRAW<br>SURF_NOLIGHT<br><span style="color:#f66">removes&nbsp;SURF_BUMPLIGHT</span>
[[image:Toolsskybox2d.gif|32px]] Makes the face render the 2D [[Skybox]] only, in addition to emitting [[light_environment]] light.
| toolsplayerclip
|
| Makes the brush only block [[player]]s.
|- id="%compileplayercontrolclip"
| [[%CompilePlayerControlClip]]
| CONTENTS_DETAIL<br>CONTENTS_MIST<br>SURF_NODRAW<br>SURF_NOLIGHT<br><span style="color:#f66">removes&nbsp;SURF_BUMPLIGHT</span>
| toolscontrolclip
| {{src07|removed}}
| Unsure as to how this was meant to be used. Usually seen together with {{ent|func_vehicleclip}}.<br>Material also uses {{cmd|$surfaceprop|player_control_clip}}.
|- id="%CompileGrenadeClip"
| [[%CompileGrenadeClip]]
| CONTENTS_DETAIL<br>CONTENTS_GRENADECLIP<br>SURF_NODRAW<br>SURF_NOLIGHT<br><span style="color:#f66">removes&nbsp;SURF_BUMPLIGHT</span>
| toolsgrenadeclip
| {{csgo|since}}
| Makes the brush only block grenades.
|- id="%CompileDroneClip"
| [[%CompileDroneClip]]
| {{confirm|Probably like %CompileGrenadeClip, but with CONTENTS_DRONECLIP instead of CONTENTS_GRENADECLIP.}}
| toolsdroneclip
| {{since|{{csgo}}{{csgo mode|dangerzone}}}}
| Makes the brush only block drones.
|- id="%TeamClip"
| [[%TeamClip]]
| {{confirm|Probably same as %PlayerClip, but with the addition of CONTENTS_TEAM1 or CONTENTS_TEAM2.}}
| toolsplayerclip_teamone<br>toolsplayerclip_teamtwo
| {{only|{{insurgency}}{{confirm}} {{doi}}}}
| Makes the brush only block a specific team. Unlike other compile parameters, this isn't a Boolean, but instead is an integer which is either 1 or 2.
|}


=== %PlayerClip (<code>tools/toolsplayerclip</code>) ===  
====Other====
[[image:Toolsplayerclip.gif|32px]] Makes the brush only block players.
{| class="standard-table"
! VMT flag
! [[BSP flags]] assigned
! Seen in VMT(s)
! Availability
! Description
|- id="%Compile2DSky"
| [[%Compile2DSky]]
| SURF_SKY<br>SURF_SKY2D<br>SURF_NOLIGHT<br><span style="color:#f66">removes&nbsp;SURF_BUMPLIGHT</span>
| toolsskybox2d
|
| Makes the face render the 2D [[Skybox]] only, in addition to emitting <tt>light_environment</tt> light.
|- id="%CompileFog"
| [[%CompileFog]]
| none
| ToolsFog
| None
| This may be a deprecated flag that so far has not been seen as being useful.
|- id="%CompileHint"
| [[%CompileHint]]
| SURF_NODRAW<br>SURF_NOLIGHT<br>SURF_HINT<br><span style="color:#f66">removes&nbsp;SURF_BUMPLIGHT</span>
| toolshint
|
| Makes the face hint-cut [[visleaf]]s. This implies <tt>NoLight</tt> and <tt>NoDraw</tt>.
|- id="%CompileNoChop"]]
| [[%CompileNoChop]]
| SURF_NOCHOP
|
|
| Prevents subdividing patches on the surface for lightmapping ("[[chop]]ping"). Also affects how the face is converted to triangles. A brush face using a material with this parameter will be limited to 31x31 luxels.
|- id="%CompileNoLight"
| [[%CompileNoLight]]
| SURF_NOLIGHT<br><span style="color:#f66">removes&nbsp;SURF_BUMPLIGHT</span>
| nolight
| {{as|since}}
{{src13|also}}
| Disables generating lightmaps for a brush face. Useful for materials that don't need lighting info or are always invisible. This is disabled on water materials. Not necessary for [[UnlitGeneric]] materials.
{{important|No effect in {{hammer++|4}} lighting preview.}}


=== %CompileNoLight (<code>nolight</code>) ===  
{{important|Incompatible with %compileWater}}
Disables generating lightmaps for a brush face. Useful for materials that don't need lighting info or are always invisible. This is disabled on water materials. [[Valve]] introduced this parameter with [[Alien Swarm]], using it for the black areas you see in the levels.
|- id="%CompileNoShadows"
| [[%CompileNoShadows]]
| SURF_NOSHADOWS
|
|{{only|{{slamminsrc}}}}
{{also|{{mapbase}}{{gmod}}}}
| Prevents dynamic [[shadows]] from being cast onto the surface.
|- id="%CompileOrigin"
| [[%CompileOrigin]]
| CONTENTS_ORIGIN<br>CONTENTS_DETAIL<br>SURF_NODRAW<br>SURF_NOLIGHT<br><span style="color:#f66">removes&nbsp;SURF_BUMPLIGHT</span>
| toolsorigin 
|
| {{deprecated}} Sets the origin of a brush entity ({{code|origin}} KV), for purposes such as rotation.<br>Leftover from {{mono|[[Tool textures (GoldSrc)|ORIGIN]]}} in {{gldsrc}}. Still functional, but is no longer necessary, as the {{code|origin}} KV is acknowledged by [[VBSP]] and can be visualized directly in {{hammer4|2}}.
|- id="%CompileSkip"
| [[%CompileSkip]]
| SURF_NODRAW<br>SURF_NOLIGHT<br>SURF_SKIP<br><span style="color:#f66">removes&nbsp;SURF_BUMPLIGHT</span>
| toolsskip
|
| Removes the face during compilation, making the brush into sets of planes.
|- id="%CompileSky"
| [[%CompileSky]]
| SURF_SKY<br>SURF_NOLIGHT<br><span style="color:#f66">removes&nbsp;SURF_BUMPLIGHT</span>
| toolsskybox
|
| Makes the face render the (2D/3D) [[Skybox]] and emit {{ent|light_environment}} light.
|- id="%CompileTrigger"
| [[%CompileTrigger]]
| SURF_NOLIGHT<br>SURF_TRIGGER<br><span style="color:#f66">removes&nbsp;SURF_BUMPLIGHT</span>
| toolstrigger
|
| Makes the brush suitable for [[Trigger]]s. Implies {{code|%CompileNoLight}}. If {{code|-nodrawtriggers}} is used, also assigns SURF_NODRAW.
|}


== Additive Flags ==
== Additive Flags ==
Multiple of these flags may be applied to any given material.  
Multiple of the following flags may be applied to any given material, unless it has one of the exclusive flags above.<br>
Every flag is available in all Source Engine branches, unless specifically mentioned in the <code>Availability</code> box
=== %CompileBlockLOS (<code>toolsblocklos</code>) ===
{| class="standard-table"
[[image:Toolsblocklos.gif|32px]] Makes the brush block NPC line of sight only.
! VMT flag
 
! [[BSP flags]] assigned
=== %CompileDetail ===
! Seen in VMT(s)
=Forces the brush to no longer cut visleafs, similar to [[func_detail]].
! Availability
 
! Description
=== %CompileHint(<code>toolshint</code>)===
|- id="%CompileBlockLOS"
[[image:Toolshint.gif|32px]] Makes the face hint-cut visleafs. This implies '''NoLight''' and '''NoDraw'''.
| [[%CompileBlockLOS]]
 
| CONTENTS_BLOCKLOS
=== %CompileInvisible (<code>toolsinvisible</code>) ===
| toolsblocklos
[[image:Toolsinvisible.gif|32px]] Makes a surface behave like NoDraw, but still allow bullets to pass through it. This implies '''NoLight''' also.
|
 
| Makes the brush block only the [[line of sight]] for [[NPC]]s.<br>{{note|Also works for [[bot]]s in {{csgo}}.}}
=== %CompileLadder ===
|- id="%CompileDetail"
[[image:Toolsladder.gif|32px]] Makes the brush usable as a [[func_ladder]].
| [[%CompileDetail]]
| CONTENTS_DETAIL
=== %CompileNoDraw (<code>toolsnodraw</code>) ===  
|
[[image:Toolsnodraw.gif|32px]] Makes a brush behave like <code>tools/toolsnodraw</code>.
|
 
| Forces the brush to no longer cut [[visleaf]]s, similar to {{ent|func_detail}}.
=== %CompileNonSolid ===
|- id="%CompileInvisible"
Makes the brush not solid to anything.
| [[%CompileInvisible]]
 
| CONTENTS_GRATE<br>SURF_NODRAW<br>SURF_NOLIGHT<br><span style="color:#f66">removes&nbsp;CONTENTS_SOLID</span><br><span style="color:#f66">removes&nbsp;SURF_BUMPLIGHT</span>
=== %CompileNoShadows ===
| toolsinvisible
Prevents shadows from being cast onto the texture.
|
 
| Shortcut for {{cmd|%CompileNoDraw}} + {{cmd|%CompilePassBullets}}.
=== %CompilePassBullets===
|- id="%CompileKeepLight"
Makes the brush act as a "grating" type, allowing bullets to pass through but blocking other objects. Useful for foliage or metal grates.
| [[%CompileKeepLight]]
{{bug| Non-functional in {{csgo}} and {{css}}.}}
| none
 
|
=== %CompileWater, CompileSlime ===  
|
Marks the brush as a [[Water_(shader)|water]]-type material. Makes it non-solid, allows swimming inside, etc. The slime variant switches to green splash particles. If <code>%CompileKeepLight</code> is also set, the brush will retain its lighting data.
| Tells the compiler to not set SURF_NOLIGHT
 
# when using {{code|-xbox}} VBSP parameter if {{code|%CompileWater}} is used.
=== %NoPortal {{Portal2Series}} ===
# if the shader is set to [[Water (shader)|Water]](if before {{l4d2}}) or [[UnlitGeneric]].
In Portal and Portal 2, makes the texture non-portalable, unless [[Gel_(Portal_2)|Conversion Gel]] is used.
|- id="%CompileLadder"
 
| [[%CompileLadder]]
=== %NoPaint {{Portal2}} ===
| CONTENTS_LADDER
In Portal 2, makes the material unable to be painted by [[Gel_(Portal_2)|Gel]].  
| toolsladder
|
| Makes the brush usable as a ladder, without needing to be tied to {{ent|func_ladder}}.<br>Can be applied to any material, such as <code>metal/metalladder.vmt</code> for a cheap ladder without a prop. Else also add %compilenodraw to make it invisible.
|- id="%CompileNoDraw"
| [[%CompileNoDraw]]
| SURF_NODRAW<br>SURF_NOLIGHT<br><span style="color:#f66">removes&nbsp;SURF_BUMPLIGHT</span>
| toolsnodraw
|
| Makes a brush behave like <code>tools/toolsnodraw</code>.
|- id="%CompileNonSolid"
| [[%CompileNonSolid]]
| CONTENTS_OPAQUE<br><span style="color:#f66">removes&nbsp;CONTENTS_SOLID</span>
|
|
| Makes the brush not solid to anything. ''All'' faces of the brush must have %CompileNonSolid for the brush to be nonsolid.<br>{{bug|hidetested=1|{{l4d2}} The material will be invisible if used on a brush with solid contents.}}
|- id="%CompilePassBullets"
| [[%CompilePassBullets]]
| CONTENTS_GRATE<br><span style="color:#f66">removes&nbsp;CONTENTS_SOLID</span>
|
|
| Makes the brush behave like a grating, allowing bullets to pass through but blocking other objects. Useful for foliage or metal grates.<br>{{bug|hidetested=1|Allows explosions through, but not bullets in {{tf2}}.}}
{{bug|hidetested=1|Non-functional in {{csgo|2}} and {{css|2}}.}}
|- id="%CompileTeam"
| [[%CompileTeam]]
| CONTENTS_TEAM1<br>''or''<br>CONTENTS_TEAM2
| climb_versus
| {{l4ds|since}}
| Decides which team should be affected by this tool texture. Unlike other compile parameters, this isn't a Boolean, but instead is an integer which is either 1 or 2.
|- id="%CompileWater"
| [[%CompileWater]]
| CONTENTS_WATER<br>SURF_WARP<br>SURF_NOSHADOWS<br>SURF_NODECALS<br><span style="color:#f66">removes&nbsp;CONTENTS_SOLID<br>removes&nbsp;CONTENTS_DETAIL</span>
|
|
| Marks the brush as a [[Water (shader)|water]]-type material. Makes it non-solid, allows swimming inside, etc.
|- id="%CompileWet"
| [[%CompileWet]]
| SURF_WET
|
| {{src07|removed}}
| {{deprecated}} Sets unused legacy {{quake2|2}} flag (eventually replaced with SURF_NOPORTAL; deprecated in favor of [[surface properties]].
|- id="%CompileSlime"
| [[%CompileSlime]]
| CONTENTS_SLIME<br>SURF_NODECALS<br><span style="color:#f66">removes&nbsp;CONTENTS_SOLID<br>removes&nbsp;CONTENTS_DETAIL</span>
|
|
| same as %CompileWater, but with green splash particles. <br>{{bug|hidetested=1|{{l4d2}} <tt>%CompileSlime</tt> uses default water splash particles.}}
|- id="%HotSurface"
| [[%HotSurface]]
| SURF_NOPORTAL
|
| {{csgo|since}}{{confirm}}
|
|- id="%NoPortal"
| [[%NoPortal]]
| SURF_NOPORTAL
| toolsblack_noportal
| {{src07|since}}
| {{portalseries}} Makes the texture non-portalable unless [[Gel (Portal 2)|Conversion Gel]] is used.
|- id="%NoPaint"
| [[%NoPaint]]
| SURF_NODECAL<br>(aliased&nbsp;to&nbsp;SURF_NOPAINT)
|
| {{portal2|since}}
| Makes the material unable to be painted by [[Gel (Portal 2)|Gel]]. Implies {{cmd|$nodecal}}.
|- id="%CompileStairs"
| [[%CompileStairs]]
| {{confirm}}
| toolsstairs
| {{infra|only}}
| Makes brushwork traversable up to an angle of 63.4349488, as opposed to the usual 45°.
|-
|}
[[Category:Shader parameters]]


[[Category:Material System]]
== Other <code>%</code> parameters ==
[[Category:List of Shader Parameters]]
A few other "shader parameters" start with {{code|%}}, but don't qualify as "compile flags".
{| class="standard-table"
! Key
! Parameter
! Availability
! Description
|- id="%tooltexture"
| [[%tooltexture]]
| [[texture]]
|
| Used instead of [[$basetexture]] for:
* Texture thumbnails in {{hammer|2}}
* Brush and displacement UV calculation in Hammer ''and'' in-game{{confirm}}
|- id="%notooltexture"
| [[%notooltexture]]
| [[boolean]]
| {{not|{{hammer++}}}}
| Used by {{hammer|2}} to hide the material in the texture browser. Useful for textures that don't work correctly on brushes or displacements.
|- id="%keywords"
| [[%keywords]]
| [[string]]
|
| Used to help filter textures in Hammer's texture browser. Comma-delineated.
|- id="%alphatexture"
| [[%alphatexture]]
| [[texture]]
| {{only|{{gmod}}{{mapbase}}}}
| Used to cast [[texture shadows]] instead of [[$basetexture]], even if [[$alphatest]] and/or [[$translucent]] are absent.
|- id="%rectanglemap"
| [[%rectanglemap]]
| [[texture]]
| {{only|{{hpp}}}}
| Used by {{hpp|2}} for [[Hotspot texturing]].
|}

Latest revision as of 08:25, 4 August 2025

English (en)中文 (zh)Translate (Translate)

Several special shader parameters exist that start with a % sign instead of $. These are read by the compile tools to alter the properties of the face or the brush they are attached to. Most are intended to produce the special tools/ textures, but they may also be used for other materials.
Most flags are boolean properties, except where specified.

See also Tool Textures for more detail about the propeties of individual materials.

PlacementTip.pngExample:
LightmappedGeneric
{
 $basetexture developer/custom_clip
  %compileclip 1
}
Note.pngNote:As with shader parameters, the names of compile flags are not case sensitive: %compileclip 1 and %CompileClip 1 deliver the same result.
Note.pngNote:These flags are associated with contents and surface flags which are stored in the BSP can can be stored in the VMF; see BSP flags (Source) for more information.
Todo: DeathByNuke's VBSP has %CompileChopLow, %CompileChopHigh, and %CompileChopAll, which affect how brush faces are spilt when touching other brush faces; document these.
Todo: Separate page that documents Source 2's VMAT attributes, which is successor to compile flags.

Exclusive Flags

Only one of the following flags may be set on any given material.
Every flag is available in all Source Engine branches, unless specifically mentioned in the Availability box

Clips

VMT flag BSP flags assigned Seen in VMT(s) Availability Description
%CompileClip CONTENTS_PLAYERCLIP
CONTENTS_MONSTERCLIP
SURF_NODRAW
SURF_NOLIGHT
removes SURF_BUMPLIGHT
toolsclip Makes the brush block only players and NPCs. This is equivalent to a combination of %PlayerClip and %CompileNPCClip.
%CompileNPCClip CONTENTS_MONSTERCLIP
SURF_NODRAW
SURF_NOLIGHT
removes SURF_BUMPLIGHT
toolsnpcclip Makes the brush block only NPCs. This implies NoLight and NoDraw.
Note.pngNote:Counter-Strike: Global Offensive Blocks bots, even though they are players.
%PlayerClip CONTENTS_PLAYERCLIP
SURF_NODRAW
SURF_NOLIGHT
removes SURF_BUMPLIGHT
toolsplayerclip Makes the brush only block players.
%CompilePlayerControlClip CONTENTS_DETAIL
CONTENTS_MIST
SURF_NODRAW
SURF_NOLIGHT
removes SURF_BUMPLIGHT
toolscontrolclip (removed since Source 2007) Unsure as to how this was meant to be used. Usually seen together with func_vehicleclip.
Material also uses $surfaceprop player_control_clip.
%CompileGrenadeClip CONTENTS_DETAIL
CONTENTS_GRENADECLIP
SURF_NODRAW
SURF_NOLIGHT
removes SURF_BUMPLIGHT
toolsgrenadeclip (in all games since Counter-Strike: Global Offensive) Makes the brush only block grenades.
%CompileDroneClip
Confirm:Probably like %CompileGrenadeClip, but with CONTENTS_DRONECLIP instead of CONTENTS_GRENADECLIP.
toolsdroneclip (in all games since Counter-Strike: Global OffensiveCS:GO Danger Zone) Makes the brush only block drones.
%TeamClip
Confirm:Probably same as %PlayerClip, but with the addition of CONTENTS_TEAM1 or CONTENTS_TEAM2.
toolsplayerclip_teamone
toolsplayerclip_teamtwo
(only in Insurgency[confirm] Day of Infamy) Makes the brush only block a specific team. Unlike other compile parameters, this isn't a Boolean, but instead is an integer which is either 1 or 2.

Other

VMT flag BSP flags assigned Seen in VMT(s) Availability Description
%Compile2DSky SURF_SKY
SURF_SKY2D
SURF_NOLIGHT
removes SURF_BUMPLIGHT
toolsskybox2d Makes the face render the 2D Skybox only, in addition to emitting light_environment light.
%CompileFog none ToolsFog None This may be a deprecated flag that so far has not been seen as being useful.
%CompileHint SURF_NODRAW
SURF_NOLIGHT
SURF_HINT
removes SURF_BUMPLIGHT
toolshint Makes the face hint-cut visleafs. This implies NoLight and NoDraw.
%CompileNoChop SURF_NOCHOP Prevents subdividing patches on the surface for lightmapping ("chopping"). Also affects how the face is converted to triangles. A brush face using a material with this parameter will be limited to 31x31 luxels.
%CompileNoLight SURF_NOLIGHT
removes SURF_BUMPLIGHT
nolight (in all games since Alien Swarm)

(also in Source 2013)

Disables generating lightmaps for a brush face. Useful for materials that don't need lighting info or are always invisible. This is disabled on water materials. Not necessary for UnlitGeneric materials.
Icon-Important.pngImportant:No effect in Hammer++ Hammer++ lighting preview.
Icon-Important.pngImportant:Incompatible with %compileWater
%CompileNoShadows SURF_NOSHADOWS (only in Slammin' Source Map Tools)

(also in MapbaseGarry's Mod)

Prevents dynamic shadows from being cast onto the surface.
%CompileOrigin CONTENTS_ORIGIN
CONTENTS_DETAIL
SURF_NODRAW
SURF_NOLIGHT
removes SURF_BUMPLIGHT
toolsorigin [Obsolete-notext.png Deprecated] Sets the origin of a brush entity (origin KV), for purposes such as rotation.
Leftover from ORIGIN in GoldSrc. Still functional, but is no longer necessary, as the origin KV is acknowledged by VBSP and can be visualized directly in Hammer Hammer 4.x.
%CompileSkip SURF_NODRAW
SURF_NOLIGHT
SURF_SKIP
removes SURF_BUMPLIGHT
toolsskip Removes the face during compilation, making the brush into sets of planes.
%CompileSky SURF_SKY
SURF_NOLIGHT
removes SURF_BUMPLIGHT
toolsskybox Makes the face render the (2D/3D) Skybox and emit light_environment light.
%CompileTrigger SURF_NOLIGHT
SURF_TRIGGER
removes SURF_BUMPLIGHT
toolstrigger Makes the brush suitable for Triggers. Implies %CompileNoLight. If -nodrawtriggers is used, also assigns SURF_NODRAW.

Additive Flags

Multiple of the following flags may be applied to any given material, unless it has one of the exclusive flags above.
Every flag is available in all Source Engine branches, unless specifically mentioned in the Availability box

VMT flag BSP flags assigned Seen in VMT(s) Availability Description
%CompileBlockLOS CONTENTS_BLOCKLOS toolsblocklos Makes the brush block only the line of sight for NPCs.
Note.pngNote:Also works for bots in Counter-Strike: Global Offensive.
%CompileDetail CONTENTS_DETAIL Forces the brush to no longer cut visleafs, similar to func_detail.
%CompileInvisible CONTENTS_GRATE
SURF_NODRAW
SURF_NOLIGHT
removes CONTENTS_SOLID
removes SURF_BUMPLIGHT
toolsinvisible Shortcut for %CompileNoDraw + %CompilePassBullets.
%CompileKeepLight none Tells the compiler to not set SURF_NOLIGHT
  1. when using -xbox VBSP parameter if %CompileWater is used.
  2. if the shader is set to Water(if before Left 4 Dead 2) or UnlitGeneric.
%CompileLadder CONTENTS_LADDER toolsladder Makes the brush usable as a ladder, without needing to be tied to func_ladder.
Can be applied to any material, such as metal/metalladder.vmt for a cheap ladder without a prop. Else also add %compilenodraw to make it invisible.
%CompileNoDraw SURF_NODRAW
SURF_NOLIGHT
removes SURF_BUMPLIGHT
toolsnodraw Makes a brush behave like tools/toolsnodraw.
%CompileNonSolid CONTENTS_OPAQUE
removes CONTENTS_SOLID
Makes the brush not solid to anything. All faces of the brush must have %CompileNonSolid for the brush to be nonsolid.
Icon-Bug.pngBug:Left 4 Dead 2 The material will be invisible if used on a brush with solid contents.
%CompilePassBullets CONTENTS_GRATE
removes CONTENTS_SOLID
Makes the brush behave like a grating, allowing bullets to pass through but blocking other objects. Useful for foliage or metal grates.
Icon-Bug.pngBug:Allows explosions through, but not bullets in Team Fortress 2.
%CompileTeam CONTENTS_TEAM1
or
CONTENTS_TEAM2
climb_versus (in all games since Left 4 Dead seriesLeft 4 Dead series) Decides which team should be affected by this tool texture. Unlike other compile parameters, this isn't a Boolean, but instead is an integer which is either 1 or 2.
%CompileWater CONTENTS_WATER
SURF_WARP
SURF_NOSHADOWS
SURF_NODECALS
removes CONTENTS_SOLID
removes CONTENTS_DETAIL
Marks the brush as a water-type material. Makes it non-solid, allows swimming inside, etc.
%CompileWet SURF_WET (removed since Source 2007) [Obsolete-notext.png Deprecated] Sets unused legacy Quake II Quake II flag (eventually replaced with SURF_NOPORTAL; deprecated in favor of surface properties.
%CompileSlime CONTENTS_SLIME
SURF_NODECALS
removes CONTENTS_SOLID
removes CONTENTS_DETAIL
same as %CompileWater, but with green splash particles.
Icon-Bug.pngBug:Left 4 Dead 2 %CompileSlime uses default water splash particles.
%HotSurface SURF_NOPORTAL (in all games since Counter-Strike: Global Offensive)[confirm]
%NoPortal SURF_NOPORTAL toolsblack_noportal (in all games since Source 2007) Portal series Makes the texture non-portalable unless Conversion Gel is used.
%NoPaint SURF_NODECAL
(aliased to SURF_NOPAINT)
(in all games since Portal 2) Makes the material unable to be painted by Gel. Implies $nodecal.
%CompileStairs [confirm] toolsstairs (only in INFRA) Makes brushwork traversable up to an angle of 63.4349488, as opposed to the usual 45°.

Other % parameters

A few other "shader parameters" start with %, but don't qualify as "compile flags".

Key Parameter Availability Description
%tooltexture texture Used instead of $basetexture for:
  • Texture thumbnails in Hammer Hammer
  • Brush and displacement UV calculation in Hammer and in-game[confirm]
%notooltexture boolean (not in Hammer++) Used by Hammer Hammer to hide the material in the texture browser. Useful for textures that don't work correctly on brushes or displacements.
%keywords string Used to help filter textures in Hammer's texture browser. Comma-delineated.
%alphatexture texture (only in Garry's ModMapbase) Used to cast texture shadows instead of $basetexture, even if $alphatest and/or $translucent are absent.
%rectanglemap texture (only in Hammer++) Used by Hammer++ Hammer++ for Hotspot texturing.