BSP flags (Source): Difference between revisions
SirYodaJedi (talk | contribs) |
SirYodaJedi (talk | contribs) No edit summary |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 6: | Line 6: | ||
These are normally defined via [[Material map compile flags]], but they can also be applied directly into a VMF's brush face, using {{code|"contents" "####"}} for contents flags and {{code|"flags" "####"}} for surface flags (wherein {{code|<nowiki>####</nowiki>}} is the bitfield represented in base 10 form). Some values are also defined via other means, such as [[func_detail]] for CONTENTS_DETAIL. | These are normally defined via [[Material map compile flags]], but they can also be applied directly into a VMF's brush face, using {{code|"contents" "####"}} for contents flags and {{code|"flags" "####"}} for surface flags (wherein {{code|<nowiki>####</nowiki>}} is the bitfield represented in base 10 form). Some values are also defined via other means, such as [[func_detail]] for CONTENTS_DETAIL. | ||
{{modernImportant|{{hammer4|4}} | {{modernImportant|{{hammer4|4}} strips these values! Put applicable geometry in an [[instance]] to avoid issues. This is fixed in {{hammer++|4}} since update 8870. }} | ||
Some of the contents flags are also used for MDL models, and are set using the {{cmd|$contents}} [[QC]] command. | Some of the contents flags are also used for MDL models, and are set using the {{cmd|$contents}} [[QC]] command. | ||
Line 15: | Line 15: | ||
Unlike {{quake2|2}}, surface flags are stored as a 16-bit value instead of a 32-bit value. This is because most information about how to draw the surface can be determined instead at runtime via the [[VMT]]. | Unlike {{quake2|2}}, surface flags are stored as a 16-bit value instead of a 32-bit value. This is because most information about how to draw the surface can be determined instead at runtime via the [[VMT]]. | ||
Only some of these flags will have any effect when used on displacements. | |||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! Bit !! Flag name !! Dev comment !! Description | ! Bit !! Flag name !! Dev comment !! Description | ||
|- | |- id="SURF_LIGHT" | ||
| 0x0001 | | 0x0001 | ||
| SURF_LIGHT | | SURF_LIGHT | ||
| value will hold the light strength | | value will hold the light strength | ||
| | | Only used internally by VRAD, to prevent treating texlights with SURF_NOLIGHT as having SURF_NOCHOP; not written to BSP. Comment is vestigial from {{Quake II|2}}. | ||
|- id="SURF_SLICK" | |||
|- | |||
| 0x0002 {{removed|{{src07}}}} | | 0x0002 {{removed|{{src07}}}} | ||
| SURF_SLICK | | SURF_SLICK | ||
| effects game physics{{sic}} | | effects game physics{{sic}} | ||
| {{modernDeprecated|Legacy {{quake2|2}} flag; deprecated in favor of [[surface properties]].}} | | {{modernDeprecated|Legacy {{quake2|2}} flag; deprecated in favor of [[surface properties]].}} | ||
|- | |- id="SURF_SKY2D" | ||
| 0x0002 {{since|{{src07}}}} | | 0x0002 {{since|{{src07}}}} | ||
| SURF_SKY2D | | SURF_SKY2D | ||
| don't draw, indicates we should skylight + draw 2d sky but not draw the 3D skybox | | don't draw, indicates we should skylight + draw 2d sky but not draw the 3D skybox | ||
| Shows only the 2D skybox. Set via [[ | | Shows only the 2D skybox. Set via [[%Compile2DSky]] | ||
{{ | {{note|{{cmd|%Compile2DSky}} assigns both SURF_SKY2D ''and'' SURF_SKY; if a face only has SURF_SKY2D assigned, it will not be drawn as a skybox, and light will not be cast from it.}} | ||
|- | |- id="SURF_SKY" | ||
| 0x0004 | | 0x0004 | ||
| SURF_SKY | | SURF_SKY | ||
| don't draw, but add to skybox | | don't draw, but add to skybox | ||
| Shows both the 2D and 3D skybox. Set via [[ | | Shows both the 2D and 3D skybox. Set via [[%CompileSky]] | ||
|- | |- id="SURF_WARP" | ||
| 0x0008 | | 0x0008 | ||
| SURF_WARP | | SURF_WARP | ||
| turbulent water warp | | turbulent water warp | ||
| Tells [[VVIS]] and the engine renderer that the surface is water. Set via {{cmd|%CompileWater}}, but not {{cmd|%CompileSlime}}. | | Tells [[VVIS]] and the engine renderer that the surface is water. Set via {{cmd|%CompileWater}}, but not {{cmd|%CompileSlime}}. Required for [[Water (shader)|planar reflections]] to work on world brushes. | ||
|- | |- id="SURF_TRANS" | ||
| 0x0010 | | 0x0010 | ||
| SURF_TRANS | | SURF_TRANS | ||
| ( | | (none) | ||
| Surface is translucent, either via {{cmd|$translucent}} or {{cmd|$alpha}}. | | Surface is translucent, either via {{cmd|$translucent}} or {{cmd|$alpha}}. | ||
{{ | {{note|Does not apply to {{cmd|$alphatest}}.}} | ||
|- | |- id="SURF_WET" | ||
| 0x0020 {{removed|{{src07}}}} | | 0x0020 {{removed|{{src07}}}} | ||
| SURF_WET | | SURF_WET | ||
| the surface is wet | | the surface is wet | ||
| {{modernDeprecated|Legacy {{quake2|2}} flag; deprecated in favor of [[surface properties]].}} | | {{modernDeprecated|Legacy {{quake2|2}} flag; deprecated in favor of [[surface properties]].}} | ||
|- | |- id="SURF_NOPORTAL" | ||
| 0x0020 {{since|{{src07}}}} | | 0x0020 {{since|{{src07}}}} | ||
| SURF_NOPORTAL | | SURF_NOPORTAL | ||
| the surface can not have a portal placed on it | | the surface can not have a portal placed on it | ||
| Set via [[%NoPortal]] | | Set via [[%NoPortal]] | ||
|- | |- id="SURF_FLOWING" | ||
| 0x0040 {{removed|{{hl2xbox}}}} | | 0x0040 {{removed|{{hl2xbox}}}} | ||
| SURF_FLOWING | | SURF_FLOWING | ||
| scroll towards angle | | scroll towards angle | ||
| {{modernDeprecated|Legacy {{quake2|2}} flag; deprecated in favor of [[material proxies]].}} | | {{modernDeprecated|Legacy {{quake2|2}} flag; deprecated in favor of [[material proxies]].}} | ||
|- | |- id="SURF_TRIGGER" | ||
| 0x0040 {{since|{{hl2xbox}}}} | | 0x0040 {{since|{{hl2xbox}}}} | ||
| SURF_TRIGGER | | SURF_TRIGGER | ||
| FIXME: This is an xbox hack to work around elimination of trigger surfaces, which breaks occluders | | FIXME: This is an xbox hack to work around elimination of trigger surfaces, which breaks occluders | ||
| Set via [[%CompileTrigger]]. Doesn't do anything in the PC versions. | | Set via [[%CompileTrigger]]. Doesn't do anything in the PC versions. | ||
|- | |- id="SURF_NODRAW" | ||
| 0x0080 | | 0x0080 | ||
| SURF_NODRAW | | SURF_NODRAW | ||
| don't bother referencing the texture | | don't bother referencing the texture | ||
| Set via [[%CompileNoDraw]], as well as [[material map compile flags|several other parameters]] | | Set via [[%CompileNoDraw]], as well as [[material map compile flags|several other parameters]] | ||
|- | |- id="SURF_HINT" | ||
| 0x0100 | | 0x0100 | ||
| SURF_HINT | | SURF_HINT | ||
| make a primary bsp splitter | | make a primary bsp splitter | ||
| Set via [[%CompileHint]] | | Set via [[%CompileHint]] | ||
|- | |- id="SURF_SKIP" | ||
| 0x0200 | | 0x0200 | ||
| SURF_SKIP | | SURF_SKIP | ||
| completely ignore, allowing non-closed brushes | | completely ignore, allowing non-closed brushes | ||
| Set via [[%CompileSkip]]. Should never be used on anything except a hint brush. | | Set via [[%CompileSkip]]. Should never be used on anything except a hint brush. | ||
|- | |- id="SURF_NOLIGHT" | ||
| 0x0400 | | 0x0400 | ||
| SURF_NOLIGHT | | SURF_NOLIGHT | ||
Line 92: | Line 93: | ||
| Face is unlit. Set via [[%CompileNoLight]] if using {{as}} or newer or {{src13}}. | | Face is unlit. Set via [[%CompileNoLight]] if using {{as}} or newer or {{src13}}. | ||
Set automatically on [[UnlitGeneric]] materials. | Set automatically on [[UnlitGeneric]] materials. | ||
|- | |- id="SURF_BUMPLIGHT" | ||
| 0x0800 | | 0x0800 | ||
| SURF_BUMPLIGHT | | SURF_BUMPLIGHT | ||
| calculate three lightmaps for the surface for bumpmapping | | calculate three lightmaps for the surface for bumpmapping | ||
| Implied by [[$bumpmap]] and/or [[$normalmap]]. Actually calculates ''four'' | | Implied by [[$bumpmap]] and/or [[$normalmap]]. Actually calculates ''four'' lightmaps, with the fourth being used when bumpmapping is disabled. | ||
|- | |- id="SURF_NOSHADOWS" | ||
| 0x1000 | | 0x1000 | ||
| SURF_NOSHADOWS | | SURF_NOSHADOWS | ||
Line 103: | Line 104: | ||
| Using {{slammin}} or {{mapbase}} [[VBSP]], set via {{cmd|%CompileNoShadows}}. | | Using {{slammin}} or {{mapbase}} [[VBSP]], set via {{cmd|%CompileNoShadows}}. | ||
{{modernConfirm|How is it used in vanilla compilers? It seems to be unrelated to {{ent|info_no_dynamic_shadow}}.}} | {{modernConfirm|How is it used in vanilla compilers? It seems to be unrelated to {{ent|info_no_dynamic_shadow}}.}} | ||
|- | |- id="SURF_NODECALS" | ||
| 0x2000 | | 0x2000 | ||
| SURF_NODECALS | | SURF_NODECALS | ||
| Don't receive decals | | Don't receive decals | ||
| Set via [[ | | Set via [[material map compile flags|several different parameters]]. Can also set via [[%nopaint]] in {{portal2|2}}. This flag is checked before {{cmd|$nodecal}}. | ||
|- | |- id="SURF_NOCHOP" | ||
| 0x4000 | | 0x4000 | ||
| SURF_NOCHOP | | SURF_NOCHOP | ||
| Don't subdivide patches on this surface | | Don't subdivide patches on this surface | ||
| Set via [[%CompileNoChop]]. Has the side effect of affecting triangulation, as well. | | Set via [[%CompileNoChop]]. Has the side effect of affecting triangulation, as well. | ||
|- | |- id="SURF_HITBOX" | ||
| 0x8000 | | 0x8000 | ||
| SURF_HITBOX | | SURF_HITBOX | ||
| surface is part of a hitbox | | surface is part of a hitbox | ||
| {{why}} | | {{why|Seems to be used at runtime}} | ||
|- | |- | ||
|} | |} | ||
Line 133: | Line 134: | ||
|- | |- | ||
! Bit !! Flag name !! Official description !! Notes | ! Bit !! Flag name !! Official description !! Notes | ||
|- | |- id="CONTENTS_EMPTY" | ||
| 0x00000000 | | 0x00000000 | ||
| CONTENTS_EMPTY | | CONTENTS_EMPTY | ||
| No contents | | No contents | ||
| Technically not a flag, but rather the lack of any flags. This cannot be manually assigned to a surface, as brush faces with the contents field set to zero in the VMF | | Technically not a flag, but rather the lack of any flags. This cannot be manually assigned to a surface, as brush faces with the contents field set to zero in the VMF file will be treated as solid{{cn}}. Instead, use [[%CompileNonSolid]], a [[func_illusionary]], or a non-solid [[func_brush]]. | ||
|- | |- id="CONTENTS_SOLID" | ||
| 0x00000001 | | 0x00000001 | ||
| CONTENTS_SOLID | | CONTENTS_SOLID | ||
| an eye is never valid in a solid | | an eye is never valid in a solid | ||
| Default contents | | Default contents | ||
|- | |- id="CONTENTS_WINDOW" | ||
| 0x00000002 | | 0x00000002 | ||
| CONTENTS_WINDOW | | CONTENTS_WINDOW | ||
| translucent, but not watery (glass) | | translucent, but not watery (glass) | ||
| Affects [[VIS]] testing. | | Affects [[VIS]] testing. | ||
|- | |- id="CONTENTS_AUX" | ||
| 0x00000004 | | 0x00000004 | ||
| CONTENTS_AUX | | CONTENTS_AUX | ||
| (none) | | (none) | ||
| Unused. Due to this, it is non-solid. | | Unused. Due to this, it is non-solid. | ||
|- | |- id="CONTENTS_GRATE" | ||
| 0x00000008 | | 0x00000008 | ||
| CONTENTS_GRATE | | CONTENTS_GRATE | ||
| alpha-tested "grate" textures. Bullets/sight pass through, but solids don't | | alpha-tested "grate" textures. Bullets/sight pass through, but solids don't | ||
| Equivalent to a combination of two brushes: one [[%CompileNonSolid]], and the other [[%CompileClip]]. Set via {{cmd|%CompilePassBullets}} or {{cmd|$contents|"grate"}}. | | Equivalent to a combination of two brushes: one [[%CompileNonSolid]], and the other [[%CompileClip]] (in supported games). Set via {{cmd|%CompilePassBullets}} or {{cmd|$contents|"grate"}}. | ||
|- | |- id="CONTENTS_SLIME" | ||
| 0x00000010 | | 0x00000010 | ||
| CONTENTS_SLIME | | CONTENTS_SLIME | ||
| (none) | | (none) | ||
| Set via [[%CompileSlime]]. Unlike Quake II, slime does not do damage; a separate [[trigger_hurt]] should be used for this. | | Set via [[%CompileSlime]]. Unlike Quake II, slime does not do damage; a separate [[trigger_hurt]] should be used for this. | ||
|- | |- id="CONTENTS_WATER" | ||
| 0x00000020 | | 0x00000020 | ||
| CONTENTS_WATER | | CONTENTS_WATER | ||
| (none) | | (none) | ||
| Set via [[%CompileWater]]. | | Set via [[%CompileWater]]. | ||
|- | |- id="CONTENTS_MIST" | ||
| 0x00000040 {{src07|removed}} | | 0x00000040 {{src07|removed}} | ||
| CONTENTS_MIST | | CONTENTS_MIST | ||
| (none) | | (none) | ||
| Unknown purpose; only set by [[%CompilePlayerControlClip]]. In Quake II, this was simply a nonsolid brush. | | Unknown purpose; only set by [[%CompilePlayerControlClip]]. In Quake II, this was simply a nonsolid brush. | ||
|- | |- id="CONTENTS_BLOCKLOS" | ||
| 0x00000040 {{src07|since}} | | 0x00000040 {{src07|since}} | ||
| CONTENTS_BLOCKLOS | | CONTENTS_BLOCKLOS | ||
| block AI line of sight | | block AI line of sight | ||
| Blocks line of sight for [[NPC]]s and [[bot]]s. Blocks [[VIS]] unless detail contents are also present. | | Blocks line of sight for [[NPC]]s and [[bot]]s. Blocks [[VIS]] unless detail contents are also present. | ||
|- | |- id="CONTENTS_OPAQUE" | ||
| 0x00000080 | | 0x00000080 | ||
| CONTENTS_OPAQUE | | CONTENTS_OPAQUE | ||
| things that cannot be seen through (may be non-solid though) | | things that cannot be seen through (may be non-solid though) | ||
| Any [[player]]-visible brush that isn't translucent or transparent is opaque. Strangely, this is set by {{cmd|%CompileNonSolid}}. | | Any [[player]]-visible brush that isn't translucent or transparent is opaque. Strangely, this is set by {{cmd|%CompileNonSolid}}, rather than CONTENTS_MIST or CONTENTS_AUX. | ||
|- | |- id="CONTENTS_TESTFOGVOLUME" | ||
| 0x00000100 | | 0x00000100 | ||
| CONTENTS_TESTFOGVOLUME | | CONTENTS_TESTFOGVOLUME | ||
| (none) | | (none) | ||
| | | Likely was used for {{cmd|%CompileFog}} early in Half-Life 2's development, but this behavior was removed. VVIS has some code for special handling of this, but there is no way for a brush to have this contents unless the user manually adds the contents to the VMF. | ||
|- | |- id="CONTENTS_UNUSED" | ||
| 0x00000200 | | 0x00000200 | ||
| CONTENTS_UNUSED | | CONTENTS_UNUSED | ||
| (none) | | (none) | ||
| | | | ||
|- | |- id="CONTENTS_UNUSED6" | ||
| 0x00000400 {{as|removed}} | | 0x00000400 {{as|removed}} | ||
| CONTENTS_UNUSED6 | | CONTENTS_UNUSED6 | ||
| rowspan=2 | Unused<br>NOTE: If it's visible, grab from the top + update LAST_VISIBLE_CONTENTS<br>if not visible, then grab from the bottom. | | rowspan=2 | Unused<br>NOTE: If it's visible, grab from the top + update LAST_VISIBLE_CONTENTS<br>if not visible, then grab from the bottom. | ||
| | | | ||
|- | |- id="CONTENTS_BLOCKLIGHT" | ||
| 0x00000400 {{as|since}} | | 0x00000400 {{as|since}} | ||
| CONTENTS_BLOCKLIGHT | | CONTENTS_BLOCKLIGHT | ||
Line 204: | Line 205: | ||
{{modernConfirm|Is this in {{l4dbranch|2}} as well?}} | {{modernConfirm|Is this in {{l4dbranch|2}} as well?}} | ||
{{modernConfirm|Can this block dynamic lights, unlike toolsblocklight?}} | {{modernConfirm|Can this block dynamic lights, unlike toolsblocklight?}} | ||
|- | |- id="CONTENTS_TEAM1" | ||
| 0x00000800 | | 0x00000800 | ||
| CONTENTS_TEAM1 | | CONTENTS_TEAM1 | ||
| rowspan=2 | per team contents used to differentiate collisions<br>between players and objects on different teams | | rowspan=2 | per team contents used to differentiate collisions<br>between players and objects on different teams | ||
| rowspan=2 | Typically to set barriers that prevent one team from entering another team's spawn zone. | | rowspan=2 | Typically to set barriers that prevent one team from entering another team's spawn zone. | ||
Used in multiple games, including {{dods}}{{tf2}}{{l4dseries}}, but only able to be set via [[%CompileTeam]] in {{l4dseries}} and newer. | Used in multiple games, including {{dods}}{{tf2}}{{l4dseries}}, but only able to be set via [[%CompileTeam]] in {{l4dseries}} and newer if using vanilla VBSP. See [[CompileTeam#VBSP_code|that command's page]] for how to implement the command in older games' VBSPs. | ||
|- | |- id="CONTENTS_TEAM2" | ||
| 0x00001000 | | 0x00001000 | ||
| CONTENTS_TEAM2 | | CONTENTS_TEAM2 | ||
|- | |- id="CONTENTS_IGNORE_NODRAW_OPAQUE" | ||
| 0x00002000 | | 0x00002000 | ||
| CONTENTS_IGNORE_NODRAW_OPAQUE | | CONTENTS_IGNORE_NODRAW_OPAQUE | ||
| ignore CONTENTS_OPAQUE on surfaces that have SURF_NODRAW | | ignore CONTENTS_OPAQUE on surfaces that have SURF_NODRAW | ||
| | | | ||
|- | |- id="CONTENTS_MOVEABLE" | ||
| 0x00004000 | | 0x00004000 | ||
| CONTENTS_MOVEABLE | | CONTENTS_MOVEABLE | ||
| hits entities which are MOVETYPE_PUSH (doors, plats, etc.) | | hits entities which are MOVETYPE_PUSH (doors, plats, etc.) | ||
| | | Applied at runtime. | ||
|- | |- | ||
| align=center | ----------------- <!-- Dev comment regarding all subsequent flags --> | | align=center | ----------------- <!-- Dev comment regarding all subsequent flags --> | ||
Line 228: | Line 229: | ||
| remaining contents are non-visible, and don't eat brushes | | remaining contents are non-visible, and don't eat brushes | ||
| align=center | ----------------- <!-- Hyphens used to indicate as such --> | | align=center | ----------------- <!-- Hyphens used to indicate as such --> | ||
|- | |- id="CONTENTS_AREAPORTAL" | ||
| 0x00008000 | | 0x00008000 | ||
| CONTENTS_AREAPORTAL | | CONTENTS_AREAPORTAL | ||
| (none) | | (none) | ||
| Is an [[areaportal]]. | | Is an [[areaportal]]. | ||
|- | |- id="CONTENTS_PLAYERCLIP" | ||
| 0x00010000 | | 0x00010000 | ||
| CONTENTS_PLAYERCLIP | | CONTENTS_PLAYERCLIP | ||
| (none) | | (none) | ||
| Solid to [[player]]s, including [[bot]]s. | | Solid to [[player]]s, including [[bot]]s. | ||
|- | |- id="CONTENTS_MONSTERCLIP" | ||
| 0x00020000 | | 0x00020000 | ||
| CONTENTS_MONSTERCLIP | | CONTENTS_MONSTERCLIP | ||
| (none) | | (none) | ||
| Solid to [[monster]]s, better known in Source as [[NPC]]s. Also solid to [[bot]]s in CSGO, even though they are players. | | Solid to [[monster]]s, better known in Source as [[NPC]]s. Also solid to [[bot]]s in CSGO, even though they are players. Some NPCs, such as [[hostage_entity|hostages]] pass through this. | ||
|- | |- id="CONTENTS_CURRENT_0" | ||
| 0x00040000 {{portal2|removed}} | | 0x00040000 {{portal2|removed}} | ||
| CONTENTS_CURRENT_0 | | CONTENTS_CURRENT_0 | ||
| rowspan=6 | currents can be added to any other contents, and may be mixed | | rowspan=6 | currents can be added to any other contents, and may be mixed | ||
| rowspan=6 | Effectively identical to | | rowspan=6 | Effectively identical to [[trigger_push]] (with a speed of 1?{{confirm}}) traveling the specified direction. Mix these to go in diagonals. | ||
|- | |- id="CONTENTS_CURRENT_90" | ||
| 0x00080000 {{portal2|removed}} | | 0x00080000 {{portal2|removed}} | ||
| CONTENTS_CURRENT_90 | | CONTENTS_CURRENT_90 | ||
|- | |- id="CONTENTS_CURRENT_180" | ||
| 0x00100000 {{portal2|removed}} | | 0x00100000 {{portal2|removed}} | ||
| CONTENTS_CURRENT_180 | | CONTENTS_CURRENT_180 | ||
|- | |- id="CONTENTS_CURRENT_270" | ||
| 0x00200000 {{portal2|removed}} | | 0x00200000 {{portal2|removed}} | ||
| CONTENTS_CURRENT_270 | | CONTENTS_CURRENT_270 | ||
|- | |- id="CONTENTS_CURRENT_UP" | ||
| 0x00400000 {{portal2|removed}} | | 0x00400000 {{portal2|removed}} | ||
| CONTENTS_CURRENT_UP | | CONTENTS_CURRENT_UP | ||
|- | |- id="CONTENTS_CURRENT_DOWN" | ||
| 0x00800000 {{portal2|removed}} | | 0x00800000 {{portal2|removed}} | ||
| CONTENTS_CURRENT_DOWN | | CONTENTS_CURRENT_DOWN | ||
|- | |- id="CONTENTS_BRUSH_PAINT" | ||
| 0x00040000 {{portal2|since}} | | 0x00040000 {{portal2|since}} | ||
| CONTENTS_BRUSH_PAINT | | CONTENTS_BRUSH_PAINT | ||
| N/A (source code not public) | | N/A (source code not public) | ||
| | | | ||
|- | |- id="CONTENTS_GRENADECLIP" | ||
| 0x00080000 {{csgo|since}} | | 0x00080000 {{csgo|since}} | ||
| CONTENTS_GRENADECLIP | | CONTENTS_GRENADECLIP | ||
| N/A (source code not public) | | N/A (source code not public) | ||
| | | | ||
|- | |- id="CONTENTS_DRONECLIP" | ||
| 0x00100000 {{since|{{csgo mode|dangerzone}}}} | | 0x00100000 {{since|{{csgo mode|dangerzone}}}} | ||
| CONTENTS_DRONECLIP | | CONTENTS_DRONECLIP | ||
Line 279: | Line 280: | ||
| | | | ||
|- | |- | ||
| 0x00200000 | |||
| rowspan=3 | N/A | |||
| rowspan=3 | N/A (not defined) | |||
| rowspan=3 | Unused in all first-party games | |||
|- | |||
| 0x00400000 | |||
|- | |||
| 0x00800000 | |||
|- id="CONTENTS_ORIGIN" | |||
| 0x01000000 | | 0x01000000 | ||
| CONTENTS_ORIGIN | | CONTENTS_ORIGIN | ||
| removed before bsping an entity | | removed before bsping an entity | ||
| Coordinates of enter of the brush is written to the {{code|origin}} [[KV]], to dictate the pivot point of certain entities.{{deprecated}} | | Coordinates of enter of the brush is written to the {{code|origin}} [[KV]], to dictate the pivot point of certain entities.{{deprecated}} | ||
|- | |- id="CONTENTS_MONSTER" | ||
| 0x02000000 | | 0x02000000 | ||
| CONTENTS_MONSTER | | CONTENTS_MONSTER | ||
| should never be on a brush, only in game | | should never be on a brush, only in game | ||
| Is a [[monster]], better known in Source as an [[NPC]]. | | Is a [[monster]], better known in Source as an [[NPC]]. | ||
|- | |- id="CONTENTS_DEBRIS" | ||
| 0x04000000 | | 0x04000000 | ||
| CONTENTS_DEBRIS | | CONTENTS_DEBRIS | ||
| (none) | | (none) | ||
| Solid to point traces (ex [[hitscan]] weapons) and non-debris physics objects{{confirm}}. Non-solid to [[QPhysics]] entities, such as [[player]]s. | | Solid to point traces (ex [[hitscan]] weapons) and non-debris physics objects{{confirm}}. Non-solid to [[QPhysics]] entities, such as [[player]]s. Some entities, such as [[func_physbox|physics models]], apply this flag at runtime, but it should theoretically work if defined explicity. | ||
|- | |- id="CONTENTS_DETAIL" | ||
| 0x08000000 | | 0x08000000 | ||
| CONTENTS_DETAIL | | CONTENTS_DETAIL | ||
| brushes to be added after vis leafs | | brushes to be added after vis leafs | ||
| World brushes with these contents don't affect [[VIS]]. Brushes with these contents can be toggled with {{cmd|r_drawfuncdetail}}. Automatically given to any brushes in a [[func_detail]]. This flag [https://github.com/ValveSoftware/source-sdk-2013/blob/master/mp/src/utils/vbsp/map.cpp#L796 is stripped] from brushes which are part of a [[brush entity]]. | | World brushes with these contents don't affect [[VIS]]. Brushes with these contents can be toggled with {{cmd|r_drawfuncdetail}}. Automatically given to any brushes in a [[func_detail]] or which have {{cmd|%CompileDetail}} materials. This flag [https://github.com/ValveSoftware/source-sdk-2013/blob/master/mp/src/utils/vbsp/map.cpp#L796 is stripped] from brushes which are part of a [[brush entity]]. | ||
|- | |- id="CONTENTS_TRANSLUCENT" | ||
| 0x10000000 | | 0x10000000 | ||
| CONTENTS_TRANSLUCENT | | CONTENTS_TRANSLUCENT | ||
| auto set if any surface has trans | | auto set if any surface has trans | ||
| Used for alpha sorting on (non-detail) worldspawn brushes. | | Used for alpha sorting on (non-detail) worldspawn brushes. | ||
|- | |- id="CONTENTS_LADDER" | ||
| 0x20000000 | | 0x20000000 | ||
| CONTENTS_LADDER | | CONTENTS_LADDER | ||
| (none) | | (none) | ||
| Is a [[ladder]]. | | Is a [[ladder]]. Automatically given to any brushes in a {{ent|func_ladder}} or which have {{cmd|%CompileLadder}} materials. | ||
|- | |- id="CONTENTS_HITBOX" | ||
| 0x40000000 | | 0x40000000 | ||
| CONTENTS_HITBOX | | CONTENTS_HITBOX | ||
Line 317: | Line 327: | ||
| N/A | | N/A | ||
| N/A (not defined) | | N/A (not defined) | ||
| Unused | | Unused in all first party games | ||
|- | |- | ||
|} | |} | ||
{{modernCodenote|{{code|0x00000200}} and {{code|0x80000000}} can reliably be used for custom contents flags in mods shipping custom DLLs (and preferably custom VBSP).}} | {{modernCodenote|{{code|0x00000200}}, {{code|0x00200000}}, {{code|0x00400000}}, {{code|0x00800000}}, and {{code|0x80000000}} can reliably be used for custom contents flags in mods shipping custom DLLs (and preferably custom VBSP).}} | ||
== See also == | == See also == | ||
* [[MASK Types]] | * [[MASK Types]] |
Latest revision as of 16:28, 1 August 2025


public/bspflags.h
defines bitfields used to tell the game engine and compiler how a brush face should be drawn in-game (surface flags), and what should be inside the brush (contents flags). They are descended from the method used by Quake II.
These are normally defined via Material map compile flags, but they can also be applied directly into a VMF's brush face, using "contents" "####" for contents flags and "flags" "####" for surface flags (wherein #### is the bitfield represented in base 10 form). Some values are also defined via other means, such as func_detail for CONTENTS_DETAIL.



Some of the contents flags are also used for MDL models, and are set using the $contents QC command.
List of flags
Surface flags
Surface flags on different faces of a brush generally do not need to match. If two or more conflicting flags are assigned, then the flag with the lowest bit value will take priority.
Unlike Quake II, surface flags are stored as a 16-bit value instead of a 32-bit value. This is because most information about how to draw the surface can be determined instead at runtime via the VMT.
Only some of these flags will have any effect when used on displacements.
Bit | Flag name | Dev comment | Description |
---|---|---|---|
0x0001 | SURF_LIGHT | value will hold the light strength | Only used internally by VRAD, to prevent treating texlights with SURF_NOLIGHT as having SURF_NOCHOP; not written to BSP. Comment is vestigial from ![]() |
0x0002 (removed since ![]() |
SURF_SLICK | effects game physics[sic] | ![]() ![]() |
0x0002 (in all games since ![]() |
SURF_SKY2D | don't draw, indicates we should skylight + draw 2d sky but not draw the 3D skybox | Shows only the 2D skybox. Set via %Compile2DSky
![]() |
0x0004 | SURF_SKY | don't draw, but add to skybox | Shows both the 2D and 3D skybox. Set via %CompileSky |
0x0008 | SURF_WARP | turbulent water warp | Tells VVIS and the engine renderer that the surface is water. Set via %CompileWater, but not %CompileSlime. Required for planar reflections to work on world brushes. |
0x0010 | SURF_TRANS | (none) | Surface is translucent, either via $translucent or $alpha.
![]() |
0x0020 (removed since ![]() |
SURF_WET | the surface is wet | ![]() ![]() |
0x0020 (in all games since ![]() |
SURF_NOPORTAL | the surface can not have a portal placed on it | Set via %NoPortal |
0x0040 (removed since ![]() |
SURF_FLOWING | scroll towards angle | ![]() ![]() |
0x0040 (in all games since ![]() |
SURF_TRIGGER | FIXME: This is an xbox hack to work around elimination of trigger surfaces, which breaks occluders | Set via %CompileTrigger. Doesn't do anything in the PC versions. |
0x0080 | SURF_NODRAW | don't bother referencing the texture | Set via %CompileNoDraw, as well as several other parameters |
0x0100 | SURF_HINT | make a primary bsp splitter | Set via %CompileHint |
0x0200 | SURF_SKIP | completely ignore, allowing non-closed brushes | Set via %CompileSkip. Should never be used on anything except a hint brush. |
0x0400 | SURF_NOLIGHT | Don't calculate light | Face is unlit. Set via %CompileNoLight if using ![]() ![]() Set automatically on UnlitGeneric materials. |
0x0800 | SURF_BUMPLIGHT | calculate three lightmaps for the surface for bumpmapping | Implied by $bumpmap and/or $normalmap. Actually calculates four lightmaps, with the fourth being used when bumpmapping is disabled. |
0x1000 | SURF_NOSHADOWS | Don't receive shadows | Using ![]() ![]() ![]() |
0x2000 | SURF_NODECALS | Don't receive decals | Set via several different parameters. Can also set via %nopaint in ![]() |
0x4000 | SURF_NOCHOP | Don't subdivide patches on this surface | Set via %CompileNoChop. Has the side effect of affecting triangulation, as well. |
0x8000 | SURF_HITBOX | surface is part of a hitbox | Why?: Seems to be used at runtime
|

Contents flags
Contents flags on different faces of a brush almost always need to match. Mismatched contents will result in compiler errors, and leaves it up to the compiler to decide what contents a brush should have. If two or more conflicting flags are assigned, then the flag with the lowest bit value will take priority.
In addition to brushes, some of these flags can also be set on MDLs using $contents parameter. Additional flags can be set via Source Model Skin Editor.
- Document any additional flags used by third-party titles
- Test flags not available via $contents
Bit | Flag name | Official description | Notes |
---|---|---|---|
0x00000000 | CONTENTS_EMPTY | No contents | Technically not a flag, but rather the lack of any flags. This cannot be manually assigned to a surface, as brush faces with the contents field set to zero in the VMF file will be treated as solid[citation needed]. Instead, use %CompileNonSolid, a func_illusionary, or a non-solid func_brush. |
0x00000001 | CONTENTS_SOLID | an eye is never valid in a solid | Default contents |
0x00000002 | CONTENTS_WINDOW | translucent, but not watery (glass) | Affects VIS testing. |
0x00000004 | CONTENTS_AUX | (none) | Unused. Due to this, it is non-solid. |
0x00000008 | CONTENTS_GRATE | alpha-tested "grate" textures. Bullets/sight pass through, but solids don't | Equivalent to a combination of two brushes: one %CompileNonSolid, and the other %CompileClip (in supported games). Set via %CompilePassBullets or $contents "grate". |
0x00000010 | CONTENTS_SLIME | (none) | Set via %CompileSlime. Unlike Quake II, slime does not do damage; a separate trigger_hurt should be used for this. |
0x00000020 | CONTENTS_WATER | (none) | Set via %CompileWater. |
0x00000040 (removed since ![]() |
CONTENTS_MIST | (none) | Unknown purpose; only set by %CompilePlayerControlClip. In Quake II, this was simply a nonsolid brush. |
0x00000040 (in all games since ![]() |
CONTENTS_BLOCKLOS | block AI line of sight | Blocks line of sight for NPCs and bots. Blocks VIS unless detail contents are also present. |
0x00000080 | CONTENTS_OPAQUE | things that cannot be seen through (may be non-solid though) | Any player-visible brush that isn't translucent or transparent is opaque. Strangely, this is set by %CompileNonSolid, rather than CONTENTS_MIST or CONTENTS_AUX. |
0x00000100 | CONTENTS_TESTFOGVOLUME | (none) | Likely was used for %CompileFog early in Half-Life 2's development, but this behavior was removed. VVIS has some code for special handling of this, but there is no way for a brush to have this contents unless the user manually adds the contents to the VMF. |
0x00000200 | CONTENTS_UNUSED | (none) | |
0x00000400 (removed since ![]() |
CONTENTS_UNUSED6 | Unused NOTE: If it's visible, grab from the top + update LAST_VISIBLE_CONTENTS if not visible, then grab from the bottom. |
|
0x00000400 (in all games since ![]() |
CONTENTS_BLOCKLIGHT | Not actually unused; comment is vestigial.
![]() ![]() ![]() | |
0x00000800 | CONTENTS_TEAM1 | per team contents used to differentiate collisions between players and objects on different teams |
Typically to set barriers that prevent one team from entering another team's spawn zone.
Used in multiple games, including |
0x00001000 | CONTENTS_TEAM2 | ||
0x00002000 | CONTENTS_IGNORE_NODRAW_OPAQUE | ignore CONTENTS_OPAQUE on surfaces that have SURF_NODRAW | |
0x00004000 | CONTENTS_MOVEABLE | hits entities which are MOVETYPE_PUSH (doors, plats, etc.) | Applied at runtime. |
----------------- | ----------------- | remaining contents are non-visible, and don't eat brushes | ----------------- |
0x00008000 | CONTENTS_AREAPORTAL | (none) | Is an areaportal. |
0x00010000 | CONTENTS_PLAYERCLIP | (none) | Solid to players, including bots. |
0x00020000 | CONTENTS_MONSTERCLIP | (none) | Solid to monsters, better known in Source as NPCs. Also solid to bots in CSGO, even though they are players. Some NPCs, such as hostages pass through this. |
0x00040000 (removed since ![]() |
CONTENTS_CURRENT_0 | currents can be added to any other contents, and may be mixed | Effectively identical to trigger_push (with a speed of 1?[confirm]) traveling the specified direction. Mix these to go in diagonals. |
0x00080000 (removed since ![]() |
CONTENTS_CURRENT_90 | ||
0x00100000 (removed since ![]() |
CONTENTS_CURRENT_180 | ||
0x00200000 (removed since ![]() |
CONTENTS_CURRENT_270 | ||
0x00400000 (removed since ![]() |
CONTENTS_CURRENT_UP | ||
0x00800000 (removed since ![]() |
CONTENTS_CURRENT_DOWN | ||
0x00040000 (in all games since ![]() |
CONTENTS_BRUSH_PAINT | N/A (source code not public) | |
0x00080000 (in all games since ![]() |
CONTENTS_GRENADECLIP | N/A (source code not public) | |
0x00100000 (in all games since ![]() |
CONTENTS_DRONECLIP | N/A (source code not public) | |
0x00200000 | N/A | N/A (not defined) | Unused in all first-party games |
0x00400000 | |||
0x00800000 | |||
0x01000000 | CONTENTS_ORIGIN | removed before bsping an entity | Coordinates of enter of the brush is written to the origin KV, to dictate the pivot point of certain entities.[![]() |
0x02000000 | CONTENTS_MONSTER | should never be on a brush, only in game | Is a monster, better known in Source as an NPC. |
0x04000000 | CONTENTS_DEBRIS | (none) | Solid to point traces (ex hitscan weapons) and non-debris physics objects[confirm]. Non-solid to QPhysics entities, such as players. Some entities, such as physics models, apply this flag at runtime, but it should theoretically work if defined explicity. |
0x08000000 | CONTENTS_DETAIL | brushes to be added after vis leafs | World brushes with these contents don't affect VIS. Brushes with these contents can be toggled with r_drawfuncdetail. Automatically given to any brushes in a func_detail or which have %CompileDetail materials. This flag is stripped from brushes which are part of a brush entity. |
0x10000000 | CONTENTS_TRANSLUCENT | auto set if any surface has trans | Used for alpha sorting on (non-detail) worldspawn brushes. |
0x20000000 | CONTENTS_LADDER | (none) | Is a ladder. Automatically given to any brushes in a func_ladder or which have %CompileLadder materials. |
0x40000000 | CONTENTS_HITBOX | use accurate hitboxes on trace | |
0x80000000 | N/A | N/A (not defined) | Unused in all first party games |
