Brush

From Valve Developer Community
Jump to: navigation, search
English (en)Deutsch (de)Español (es)Português (pt)Português do Brasil (pt-br)Русский (ru)Українська (uk)中文 (zh)Translate (Translate)


A brush is a convex 3D shape created with Hammer's Block Tool. Brushes are used by level designers to define the shape of the world (which defines visibility) and to create brush entities.

When a map is compiled VBSP converts brush faces that touch a visleaf to groups of polygons. The resulting 'brush models' are stored within the BSP file and can be claimed by entities (e.g. the world, or your brush entity). The original brushes are retained in the BSP, though the benefits of this are not clear.

In comparison to models, brushes are:

Compilation

  1. For each individual brush model, only faces that touch a visleaf are compiled. Some of the results of this process can be seen below:

Brushes and their compiled equivalents


  1. If some parts of a brush face touch visleaves and others do not, the face will be chopped up to remove the hidden area.

There are two exceptions to these rules:

  • Although they are discrete entities in Hammer, func details are all merged into one during compile. You do not need to nodraw hidden 'detail-to-detail' faces in (but you do need to nodraw world-to-detail and detail-to-world in Source).
  • Faces with translucent materials applied are never chopped. Don't apply them to internal or hidden surfaces unless you really mean to.

Limits

VBSP enforces these limits:

  • 8192 brushes (16384 in Garry's Mod)
  • 128 faces on a single brush
  • 32768 faces overall (half of the BSP plane limit, each face uses two planes)

Invisible brushes like triggers and even hint brushes count toward the limit. Faces like NODRAW do not count toward the limit. Faces textured with NODRAW are removed during compile, so only its collisions, boundings, and place in the world remain. Note that faces may be split up by the compiler, counting them further toward the limit.

Tip.pngTip:It is possible to compile a custom build of VBSP with these limits changed or removed, but the engine's behaviour is undefined.

Even if a brush doesn't count towards VBSP's face limit, it will still count towards the engine's brushside limit, which is 65535.

See also