This article's documentation is for anything that uses the Source engine. Click here for more information.

BSP flags (Source): Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Filled the SURF_2DSKY and SURF_TRANS confirm blocks, corrected 2 minor mistakes regarding the compile flags)
Line 20: Line 20:
|-
|-
! Bit !! Flag name !! Dev comment !! Description
! Bit !! Flag name !! Dev comment !! Description
|-
|- id="SURF_LIGHT"
| 0x0001
| 0x0001
| SURF_LIGHT
| SURF_LIGHT
Line 26: Line 26:
| Normally set on any surface that matches a [[RAD file]] entry; not actually written to the BSP, unlike {{quake2|2}}.
| Normally set on any surface that matches a [[RAD file]] entry; not actually written to the BSP, unlike {{quake2|2}}.
{{modernConfirm|Can the value field be set in a VMF, or does it require regressing to MAP instead?}}
{{modernConfirm|Can the value field be set in a VMF, or does it require regressing to MAP instead?}}
|-
|- 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
Line 37: Line 37:
| Shows only the 2D skybox. Set via [[%Compile2DSky]]
| 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. Light will also not be cast from these faces anymore.}}
{{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. Light will also not be cast from these faces anymore.}}
|-
|- 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 [[%CompileSky]]
| 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}}. {{confirm|Why does VVIS read this?}}
| Tells [[VVIS]] and the engine renderer that the surface is water. Set via {{cmd|%CompileWater}}, but not {{cmd|%CompileSlime}}. {{confirm|Why does VVIS read this?}}
|-
|- id="SURF_TRANS"
| 0x0010
| 0x0010
| SURF_TRANS
| SURF_TRANS
Line 53: Line 53:
| 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}}.}}
{{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 94: Line 94:
| 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'' lightmap, with the fourth being used when bumpmapping is disabled.
| 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 105: Line 105:
| 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 [[$nodecal]]. Can also set via [[%nopaint]] in {{portal2|2}}.
| 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 135: Line 135:
|-
|-
! 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 (or MAP) file will be treated as solid{{cn}}. Instead, use [[%CompileNonSolid]], a [[func_illusionary]], or a non-solid [[func_brush]].
| 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 206: Line 206:
{{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 230: Line 230:
| 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 a [[trigger_push]] traveling the same direction. Mix these to go in diagonals.
| 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
| N/A (source code not public)
| N/A (source code not public)
|
|
|-
|- 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]]. Automati cally given to any brushes in a {{ent|func_ladder}} or which have {{cmd|%CompileLadder}} materials.
|-
|- id="CONTENTS_HITBOX"
| 0x40000000
| 0x40000000
| CONTENTS_HITBOX
| CONTENTS_HITBOX

Revision as of 09:34, 1 May 2025

English (en)Translate (Translate)

edit

🖿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.

Icon-Important.pngImportant:Hammer Hammer 4.x (including Hammer++ Hammer++) strips these values! Put applicable geometry in an instance to avoid issues.

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 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 Normally set on any surface that matches a RAD file entry; not actually written to the BSP, unlike Quake II Quake II.
Confirm:Can the value field be set in a VMF, or does it require regressing to MAP instead?
0x0002 (removed since Source 2007) SURF_SLICK effects game physics[sic]
Obsolete-notext.pngDeprecated:Legacy Quake II Quake II flag; deprecated in favor of surface properties.
0x0002 (in all games since Source 2007) 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
Note.pngNote:%Compile2DSky assigns both SURF_SKY2D and SURF_SKY; if a face only has SURF_SKY2D assigned, it will not be drawn as a skybox. Light will also not be cast from these faces anymore.
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.
Confirm:Why does VVIS read this?
0x0010 SURF_TRANS (none) Surface is translucent, either via $translucent or $alpha.
Note.pngNote:Does not apply to $alphatest.
0x0020 (removed since Source 2007) SURF_WET the surface is wet
Obsolete-notext.pngDeprecated:Legacy Quake II Quake II flag; deprecated in favor of surface properties.
0x0020 (in all games since Source 2007) SURF_NOPORTAL the surface can not have a portal placed on it Set via %NoPortal
0x0040 (removed since Half-Life 2 (Xbox)) SURF_FLOWING scroll towards angle
Obsolete-notext.pngDeprecated:Legacy Quake II Quake II flag; deprecated in favor of material proxies.
0x0040 (in all games since Half-Life 2 (Xbox)) 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 Alien Swarm or newer or Source 2013.

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 Slammin' Source Map Tools or Mapbase VBSP, set via %CompileNoShadows.
Confirm:How is it used in vanilla compilers? It seems to be unrelated to info_no_dynamic_shadow.
0x2000 SURF_NODECALS Don't receive decals Set via several different parameters. Can also set via %nopaint in Portal 2 Portal 2. This flag is checked before $nodecal.
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
Cpp.pngCode:0x0020 can reliably be used as a custom surface flag on mods not using portals.

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 Source Model Skin Editor.

Todo: 
  • 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 Source 2007) CONTENTS_MIST (none) Unknown purpose; only set by %CompilePlayerControlClip. In Quake II, this was simply a nonsolid brush.
0x00000040 (in all games since Source 2007) 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 Alien Swarm) 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 Alien Swarm) CONTENTS_BLOCKLIGHT Not actually unused; comment is vestigial.
Confirm:Is this in Left 4 Dead engine branch Left 4 Dead engine branch as well?
Confirm:Can this block dynamic lights, unlike toolsblocklight?
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 Day of Defeat: SourceTeam Fortress 2Left 4 Dead seriesLeft 4 Dead series, but only able to be set via %CompileTeam in Left 4 Dead seriesLeft 4 Dead series and newer if using vanilla VBSP. See that command's page for how to implement the command in older games' VBSPs.

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 Portal 2) 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 Portal 2) CONTENTS_CURRENT_90
0x00100000 (removed since Portal 2) CONTENTS_CURRENT_180
0x00200000 (removed since Portal 2) CONTENTS_CURRENT_270
0x00400000 (removed since Portal 2) CONTENTS_CURRENT_UP
0x00800000 (removed since Portal 2) CONTENTS_CURRENT_DOWN
0x00040000 (in all games since Portal 2) CONTENTS_BRUSH_PAINT N/A (source code not public)
0x00080000 (in all games since Counter-Strike: Global Offensive) CONTENTS_GRENADECLIP N/A (source code not public)
0x00100000 (in all games since CS:GO Danger Zone) CONTENTS_DRONECLIP N/A (source code not public)
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.[Obsolete-notext.png Deprecated]
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. Automati cally 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
Cpp.pngCode:0x00000200 and 0x80000000 can reliably be used for custom contents flags in mods shipping custom DLLs (and preferably custom VBSP).

See also