BSP flags (Source): Difference between revisions
SirYodaJedi (talk | contribs) (→Surface flags: fill out section) |
SirYodaJedi (talk | contribs) (→Surface flags: Descriptions) |
||
| Line 23: | Line 23: | ||
| 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 [[$Compile2DSky]] | ||
|- | |- | ||
| 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]] | ||
|- | |- | ||
| 0x0008 | | 0x0008 | ||
| Line 37: | Line 37: | ||
| 0x0010 | | 0x0010 | ||
| SURF_TRANS | | SURF_TRANS | ||
| None | | (None) | ||
| Surface is translucent, either via {{cmd|$translucent}} or {{cmd|$alpha}}. | | Surface is translucent, either via {{cmd|$translucent}} or {{cmd|$alpha}}. | ||
{{modernConfirm|Might also apply to {{cmd|$alphatest}}. | {{modernConfirm|Might also apply to {{cmd|$alphatest}}. | ||
| Line 44: | Line 44: | ||
| 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]] | ||
|- | |- | ||
| 0x0040 | | 0x0040 | ||
| 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 | ||
| {{modernConfirm|Might also do something if [[VRAD]] is run with {{code|-nodrawtriggers}}. | | Set via [[%CompileTrigger]] | ||
{{modernConfirm|Might also do something if [[VRAD]] is run with {{code|-nodrawtriggers}}. | |||
|- | |- | ||
| 0x0080 | | 0x0080 | ||
| SURF_NODRAW | | SURF_NODRAW | ||
| don't bother referencing the texture | | don't bother referencing the texture | ||
| | | Set via [[%CompileNoDraw]] | ||
|- | |- | ||
| 0x0100 | | 0x0100 | ||
| SURF_HINT | | SURF_HINT | ||
| make a primary bsp splitter | | make a primary bsp splitter | ||
| | | Set via [[%CompileHint]] | ||
|- | |- | ||
| 0x0200 | | 0x0200 | ||
| SURF_SKIP | | SURF_SKIP | ||
| completely ignore, allowing non-closed brushes | | completely ignore, allowing non-closed brushes | ||
| Should never be used on anything except a hint brush. | | Set via [[%CompileSkip]]. Should never be used on anything except a hint brush. | ||
|- | |- | ||
| 0x0400 | | 0x0400 | ||
| SURF_NOLIGHT | | SURF_NOLIGHT | ||
| Don't calculate light | | Don't calculate light | ||
| Face is unlit. | | Face is unlit. Set via [[%CompileNoLight]] if using {{as}} or newer or {{src13}}. | ||
{{modernConfirm|Might be set automatically on [[UnlitGeneric]] materials.}} | |||
|- | |- | ||
| 0x0800 | | 0x0800 | ||
| SURF_BUMPLIGHT | | SURF_BUMPLIGHT | ||
| calculate three lightmaps for the surface for bumpmapping | | calculate three lightmaps for the surface for bumpmapping | ||
| This is probably why [[ssbump]]s are cheaper to render than regular normal maps. | | Implied by [[$bumpmap]]. | ||
This is probably why [[ssbump]]s are cheaper to render than regular normal maps. | |||
|- | |- | ||
| 0x1000 | | 0x1000 | ||
| Line 89: | Line 92: | ||
| 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. | ||
|- | |- | ||
| 0x8000 | | 0x8000 | ||
| SURF_HITBOX | | SURF_HITBOX | ||
| surface is part of a hitbox | | surface is part of a hitbox | ||
| | | {{why}} | ||
|- | |- | ||
|} | |} | ||
Revision as of 14:21, 22 December 2023
Remember to check for any notes left by the tagger at this article's talk page.
![]()
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.
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.
| 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.
|
| 0x0002 | 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 | |
| 0x0010 | SURF_TRANS | (None) | Surface is translucent, either via $translucent or $alpha.
{{modernConfirm|Might also apply to |
| 0x0020 | SURF_NOPORTAL | the surface can not have a portal placed on it | Set via %NoPortal |
| 0x0040 | SURF_TRIGGER | FIXME: This is an xbox hack to work around elimination of trigger surfaces, which breaks occluders | Set via %CompileTrigger
{{modernConfirm|Might also do something if VRAD is run with |
| 0x0080 | SURF_NODRAW | don't bother referencing the texture | Set via %CompileNoDraw |
| 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 |
| 0x0800 | SURF_BUMPLIGHT | calculate three lightmaps for the surface for bumpmapping | Implied by $bumpmap.
This is probably why ssbumps are cheaper to render than regular normal maps. |
| 0x1000 | SURF_NOSHADOWS | Don't receive shadows | |
| 0x2000 | SURF_NODECALS | Don't receive decals | Given by $nodecal VMT parm, as well as %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?] |
Content flags
Content 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.
| Bit | Flag name | Official description | Notes |
|---|---|---|---|
| 0x00000000 |