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

func_detail

From Valve Developer Community
Jump to: navigation, search
English (en)中文 (zh)
... Icon-Important.png

func_detail is a internal brush entity available in all Source Source games. It is not an actual brush entity, but rather moves all contained brushes to worldspawn and flags them as CONTENTS_DETAIL, resulting in them not affecting visibility or chopping non-detail brushes. All brushwork that does not form the 'backbone' of the world (and that is not tied to a real entity) should be detail, with the exception of translucent glass (which suffers from alpha sorting issues when not "structural").

Valve provides an example map at 🖿sourcesdk_content\hl2\mapsrc\sdk_func_detail.vmf. You can also load up the HL2 map sources and hide detail brushes with their auto visgroup to see where Valve used them.

Tip.pngTip:Alternatively, use the console variable r_drawfuncdetail 0 to hide detail brushes in any map while it is running.

Effects

The point of creating a detail brush entity is to avoid creating an unnecessary number of visleaves for a mere detail of the map, hence the name of the entity. VBSP will allow visleaves to overlay details, and thus minimize visleaves and compile time.

World-vs-detail.png

Above are a world brush (left cylinder) and a detail brush (right cylinder). The blue lines are visleaf boundaries. The world brush has chopped the map into nine oddly-shaped segments, leading to longer compile times and marginally lower performance, while the detail brush has not changed anything.

Caveats

  • Detail brushes cannot be used to seal a map, or areaportal areas.
  • Because detail brushes do not chop world brushes, light can seep underneath them if the other surface's lightmap scale is larger than the detail brush is wide/tall. If you encounter this, manually slice the underlying brush in multiple parts (with Shift+X), and texture underneath with nodraw.
    • This effect can cause detail brushes with lots of surface contact to become inefficient, because the surface beneath them is being rendered too! Structural faces which are completely obscured by func_detail should be textured with nodraw.
    • Detail brushes do chop each other, however. Vanilla VBSP does not support detail levels as seen in GoldSrc HLBSP, so all detail brushes will chop each over with no bias.
  • Surfaces on very thin (about 2 units thick) detail brushes have been known to disappear at certain distances. As a workaround, use func_brush instead.
  • World brushes with translucent and/or transparent materials applied, or which are displacements, do not affect VIS, and cannot seal areas.
    • World brushes w/ translucent material will still chop leaves. This is because they use BSP tree to assist in alpha sorting (like in Quake II Quake II) unlike detail brushes, displacements, and entities.
  • Detail brushes will, in some cases, merge faces with other detail brushes, and on occasion, world brushes, which can cause them to create leaves.
  • Under normal conditions, any time a detail brush contacts a world brush, VBSP will note the junction and optimize it. This connection is known alternately as a T-junction and a water index, and there is a limit to the number of T-Junctions VBSP will attempt to fix (65,535). Excessive use of detail brushes in contact with world geometry could cause VBSP to abort compilation with an error. Using the -notjunc option will skip this optimization at the price of possible visual inconsistencies.
Note.pngNote:Water, for unknown reasons, causes the t-junction count to skyrocket. Removing/reshaping bodies of water can overcome this.

Good candidates

There's not much left of City 17 Trainstation Plaza once we remove detail brushes (and props). Valve has missed a few world brushes as well...

Any brush which doesn't significantly block the player's view should probably be detail. Specific examples include:

  • Pillars, plinths and supports
  • Free-standing walls
  • Suspended walkways
  • Steps (create a smooth wedge-shaped world brush underneath)
  • Small buildings
  • Rotated brushes
  • Very small or thin brushes

Keyvalues

DXLevelChoice:

Minimum / Maximum DX Level (mindxlevel / maxdxlevel) <choices> (removed since Left 4 Dead)
The entity will not exist if the engine is running outside the given range of DirectX Versions.
Choices
Warning.pngWarning:If these are used, the object may break when the user switches their DirectX settings.

See also