Material map compile flags: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 21: Line 21:
====Clips====
====Clips====
{| class="standard-table"
{| class="standard-table"
! width="150px" | Name
! VMT flag
! width="100px" | Seen in .vmt
! [[BSP flags]] assigned
! width="150px" | Availability
! Seen in VMT(s)
! Effect
! Availability
! Description
|- id="%CompileClip"
|- id="%CompileClip"
| [[%CompileClip]]
| [[%CompileClip]]
| CONTENTS_PLAYERCLIP<br>CONTENTS_MONSTERCLIP<br>SURF_NODRAW<br>SURF_NOLIGHT
| toolsclip  
| toolsclip  
|  
|  
Line 32: Line 34:
|- id="%CompileNPCClip"
|- id="%CompileNPCClip"
| [[%CompileNPCClip]]
| [[%CompileNPCClip]]
| CONTENTS_MONSTERCLIP<br>SURF_NODRAW<br>SURF_NOLIGHT
| toolsnpcclip  
| toolsnpcclip  
|  
|  
Line 37: Line 40:
|- id="%PlayerClip"
|- id="%PlayerClip"
| [[%PlayerClip]]
| [[%PlayerClip]]
| CONTENTS_PLAYERCLIP<br>SURF_NODRAW<br>SURF_NOLIGHT
| toolsplayerclip  
| toolsplayerclip  
|  
|  
Line 42: Line 46:
|- id="%compileplayercontrolclip"
|- id="%compileplayercontrolclip"
| [[%CompilePlayerControlClip]]
| [[%CompilePlayerControlClip]]
| none
| toolscontrolclip  
| toolscontrolclip  
| {{hl2ep2|removed}}
| {{hl2ep2|removed}}
Line 48: Line 53:
|- id="%CompileGrenadeClip"
|- id="%CompileGrenadeClip"
| [[%CompileGrenadeClip]]
| [[%CompileGrenadeClip]]
| unknown
| toolsgrenadeclip
| toolsgrenadeclip
| {{csgo|only}}
| {{csgo|only}}
Line 53: Line 59:
|- id="%CompileDroneClip"
|- id="%CompileDroneClip"
| [[%CompileDroneClip]]
| [[%CompileDroneClip]]
| unknown
| toolsdroneclip
| toolsdroneclip
| {{csgo|only}}
| {{csgo|only}}
Line 60: Line 67:
====Other====
====Other====
{| class="standard-table"
{| class="standard-table"
! width="150px" | Name
! VMT flag
! width="100px" | Seen in .vmt
! [[BSP flags]] assigned
! width="150px" | Availability
! Seen in VMT(s)
! Effect
! Availability
! Description
|- id="%Compile2DSky"
|- id="%Compile2DSky"
| [[%Compile2DSky]]
| [[%Compile2DSky]]
| SURF_SKY<br>SURF_SKY2D<br>SURF_NOLIGHT
| toolsskybox2d  
| toolsskybox2d  
|  
|  
Line 71: Line 80:
|- id="%CompileFog"
|- id="%CompileFog"
| [[%CompileFog]]
| [[%CompileFog]]
| none
| ToolsFog
| ToolsFog
|  
|  
| This may be a deprecated flag that so far has not been seen as being useful.
| 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
| toolshint
|
| Makes the face hint-cut [[visleaf]]s. This implies <tt>NoLight</tt> and <tt>NoDraw</tt>.
|- id="%CompileNoChop"]]
|- id="%CompileNoChop"]]
| [[%CompileNoChop]]
| [[%CompileNoChop]]
| SURF_NOCHOP
|  
|  
|  
|  
Line 81: Line 98:
|- id="%CompileNoLight"
|- id="%CompileNoLight"
| [[%CompileNoLight]]
| [[%CompileNoLight]]
| SURF_NOLIGHT
| nolight  
| nolight  
| {{as|since}}
| {{as|since}}
Line 89: Line 107:
|- id="%CompileOrigin"
|- id="%CompileOrigin"
| [[%CompileOrigin]]
| [[%CompileOrigin]]
| CONTENTS_ORIGIN<br>CONTENTS_DETAIL<br>SURF_NODRAW<br>SURF_NOLIGHT
| toolsorigin   
| toolsorigin   
|  
|  
Line 94: Line 113:
|- id="%CompileSkip"
|- id="%CompileSkip"
| [[%CompileSkip]]
| [[%CompileSkip]]
| SURF_NODRAW<br>SURF_NOLIGHT<br>SURF_SKIP
| toolsskip  
| toolsskip  
|  
|  
Line 99: Line 119:
|- id="%CompileSky"
|- id="%CompileSky"
| [[%CompileSky]]
| [[%CompileSky]]
| SURF_SKY<br>SURF_NOLIGHT
| toolsskybox  
| toolsskybox  
|  
|  
Line 104: Line 125:
|- id="%CompileTrigger"
|- id="%CompileTrigger"
| [[%CompileTrigger]]
| [[%CompileTrigger]]
| SURF_NOLIGHT<br>SURF_TRIGGER
| toolstrigger  
| toolstrigger  
|  
|  
| Makes the brush suitable for [[Trigger]]s. Implies {{code|%CompileNoLight}}.
| Makes the brush suitable for [[Trigger]]s. Implies {{code|%CompileNoLight}}. If {{code|-nodrawtriggers}} is used, also assigns SURF_NODRAW.
|}
|}


Line 127: Line 149:
|  
|  
| Forces the brush to no longer cut [[visleaf]]s, similar to {{ent|func_detail}}.  
| Forces the brush to no longer cut [[visleaf]]s, similar to {{ent|func_detail}}.  
|- id="%CompileHint"
| [[%CompileHint]]
| toolshint
|
| Makes the face hint-cut [[visleaf]]s. This implies <tt>NoLight</tt> and <tt>NoDraw</tt>.
|- id="%CompileInvisible"
|- id="%CompileInvisible"
| [[%CompileInvisible]]
| [[%CompileInvisible]]

Revision as of 14:38, 3 August 2024

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.
All flags are boolean properties and invisible to players. So far %CompileLadder is the only flag which may be visible to players, depending on the proxies inside the material. %CompileTeam Is also the only flag that is not a boolean.

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.

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
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
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
toolsplayerclip Makes the brush only block players.
%CompilePlayerControlClip none toolscontrolclip (removed since Half-Life 2: Episode Two)

(also in Garry's Mod)

Unsure as to how this was meant to be used. Usually seen together with func_vehicleclip.
Material also uses $surfaceprop player_control_clip.
%CompileGrenadeClip unknown toolsgrenadeclip (only in Counter-Strike: Global Offensive) Makes the brush only block grenades.
%CompileDroneClip unknown toolsdroneclip (only in Counter-Strike: Global Offensive) Makes the brush only block drones.

Other

VMT flag BSP flags assigned Seen in VMT(s) Availability Description
%Compile2DSky SURF_SKY
SURF_SKY2D
SURF_NOLIGHT
toolsskybox2d Makes the face render the 2D Skybox only, in addition to emitting light_environment light.
%CompileFog none ToolsFog This may be a deprecated flag that so far has not been seen as being useful.
%CompileHint SURF_NODRAW
SURF_NOLIGHT
SURF_HINT
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 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.
Confirm:Is this necessary for UnlitGeneric materials?
Icon-Important.pngImportant:No effect in Hammer++ Hammer++ lighting preview.
%CompileOrigin CONTENTS_ORIGIN
CONTENTS_DETAIL
SURF_NODRAW
SURF_NOLIGHT
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
toolsskip Removes the face during compilation, making the brush into sets of planes.
%CompileSky SURF_SKY
SURF_NOLIGHT
toolsskybox Makes the face render the (2D/3D) Skybox and emit light_environment light.
%CompileTrigger SURF_NOLIGHT
SURF_TRIGGER
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.
Every flag is available in all Source Engine branches, unless specifically mentioned in the Availability box

Name Seen in .vmt Availability Effect
%CompileBlockLOS toolsblocklos Makes the brush block only the line of sight for NPCs.
Note.pngNote:Also works for bots in Counter-Strike: Global Offensive.
%CompileDetail Forces the brush to no longer cut visleafs, similar to func_detail.
%CompileInvisible toolsinvisible Makes a surface behave like NoDraw, but still allows bullets to pass through it, except in Counter-Strike: Global Offensive Counter-Strike: Global Offensive. This also implies NoLight.
%CompileLadder 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 toolsnodraw Makes a brush behave like tools/toolsnodraw.
%CompileNonSolid Makes the brush not solid to anything.
Icon-Bug.pngBug:Left 4 Dead 2 Turns brushes non-solid and invisible but still casts shadows.  [todo tested in ?]
Tip.pngTip:Analogous to NOCLIP tool texture in GoldSrc GoldSrc (ZHLT, VHLT, and derivatives)
%CompileNoShadows (only in Slammin' Source Map Tools)

(also in Mapbase)

Prevents shadows from being cast onto the texture.
%CompilePassBullets Makes the brush behave like a grating, allowing bullets to pass through but blocking other objects. Useful for foliage or metal grates.
Note.pngNote:Allows explosions through, but not bullets in Team Fortress 2.
Icon-Bug.pngBug:Non-functional in Counter-Strike: Global Offensive Counter-Strike: Global Offensive and Counter-Strike: Source Counter-Strike: Source.  [todo tested in ?]
%CompileTeam climb_versus (only in Left 4 Dead seriesLeft 4 Dead series) Decides which team should be affected by this tool texture.
%CompileWater Marks the brush as a water-type material. Makes it non-solid, allows swimming inside, etc. If %CompileKeepLight is also set, the brush will retain its lighting data.
%CompileSlime same as %CompileWater, but with green splash particles.
Icon-Bug.pngBug:Left 4 Dead 2 %CompileSlime uses default water splash particles.  [todo tested in ?]
%NoPortal toolsblack_noportal (only in Portal series) Makes the texture non-portalable unless Conversion Gel is used.
%NoPaint (in all games since Portal 2) Makes the material unable to be painted by Gel.

Implies $nodecal, as they share a surface flag.

%CompileStairs toolsstairs (only in INFRA) Makes brushwork traversable up to an angle of 63.4349488, as opposed to the usual 45°.
$NoDecal Makes the material not receive decals.
Icon-Important.pngImportant:This is a map compile flag when used on brushes and displacements, but not when used on models, hence why it starts with $ instead of %.