Brush: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(brushes -> compiled polys)
(redone)
Line 1: Line 1:
A '''brush''' is a [[Wikipedia:Convex and concave polygons|convex]] 3D shape created with [[Hammer]]'s [[Hammer Block Tool|Block tool]]. Unless tied to an [[Brush entity|entity]] it will form part of the backbone of the map, defining [[visibility]] as a [[worldspawn|world brush]].
{{otherlang2
| pt = Brush:pt
| pt-br = Brush:pt-br
| ru = Brush:ru}}


Brushes are each unique, can't sustain huge amounts of detail, and are lit with pre-computed [[lightmap]]s. They are complimented by [[model]]s, which are more dynamic, more detailed, and exactly the same whenever and wherever used.
A '''brush''' is a [[Wikipedia:Convex and concave polygons|convex]] 3D shape created with [[Hammer]]'s [[Hammer Block Tool|Block Tool]]. Brushes are used by level designers define the shape of the [[world]] (which defines [[visibility]]) and to create [[brush entity|brush entities]].


== In-game ==
When a map is compiled [[VBSP]] converts brush faces that touch a [[visleaf]] to individual 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 brushes themselves are actually retained in the BSP, though the reasons for Valve doing so are not clear.


Brushes are compiled by [[VBSP]] into individual polygons, which means that unless tied to an entity they only exist as discrete objects in Hammer.
In comparison to [[model]]s, brushes are:


As a part of this process faces are merged and chopped so that parts touching either the void or one another are removed. You can see some scenarios in this image:
* Unique every time
* Low-detail and [[cheap]]
* Lit with pre-computed [[lightmap]]s


[[Image:Optimize.jpg|750px|center|Brushes and their in-game result]]
== Compilation ==


Exceptions are:
# For each individual brush model, only faces that touch a visleaf are compiled. Some of the results of this process can be seen below:<p>[[File:Brushes compiled.png|750px|Brushes and their compiled equivalents]]</p>
# If some parts of a brush face look into visleaves and others do not, the face will be chopped up accordingly.


* [[Brush entity|Brush entities]], which merge and chop only within themselves.
There are two exceptions to these rules:
** [[func_detail]]s will also merge and chop each other (since they are really all the same entity).
* Brushes with [[$translucent|translucent]] materials applied, which do not merge or chop at all.


Don't bother coating the inner surfaces of brush constructions with [[nodraw]] unless they meet one of the above criteria.
* Although created separately in Hammer, [[func_detail]]s are all merged into the same entity during a compile. The single brush model that results is later added to the world. {{note|This means that you should always apply [[nodraw]] to hidden surfaces between a func_detail and the world.}}
* Faces with [[$translucent|translucent]] materials applied are never chopped. Don't apply them to internal or hidden surfaces unless you really mean to.


{{note|Surfaces that are merely flush with one another will not be merged. Doing so would disrupt texturing.}}
== Limits ==
 
VBSP enforces these limits:
 
* 8192 brushes
* 128 faces on a single brush
* 65536 faces overall
 
Invisible brushes like [[trigger_multiple|triggers]] and even [[hint brush]]es count toward the limit. {{confirm|However, [[nodraw]] faces do not.}}
 
{{tip|It is possible to compile a custom build of VBSP with these limits changed or removed, but who knows how the engine would respond?}}


== See also ==
== See also ==
Line 27: Line 42:
* [[Model]]
* [[Model]]
* [[Displacement]]
* [[Displacement]]
{{otherlang:en}}
{{otherlang:en:pt|Brush:pt}},
{{otherlang:en:pt-br|Brush:pt-br}},
{{otherlang:en:ru|Brush:ru}}


[[Category:Level Design]]
[[Category:Level Design]]
[[Category:Glossary]]
[[Category:Glossary]]

Revision as of 16:46, 11 January 2010

Template:Otherlang2

A brush is a convex 3D shape created with Hammer's Block Tool. Brushes are used by level designers 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 individual 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 brushes themselves are actually retained in the BSP, though the reasons for Valve doing so are not clear.

In comparison to models, brushes are:

  • Unique every time
  • Low-detail and cheap
  • Lit with pre-computed lightmaps

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

  2. If some parts of a brush face look into visleaves and others do not, the face will be chopped up accordingly.

There are two exceptions to these rules:

  • Although created separately in Hammer, func_details are all merged into the same entity during a compile. The single brush model that results is later added to the world.
    Note.pngNote:This means that you should always apply nodraw to hidden surfaces between a func_detail and the world.
  • 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
  • 128 faces on a single brush
  • 65536 faces overall

Invisible brushes like triggers and even hint brushes count toward the limit.

Confirm:However, nodraw faces do not.
Tip.pngTip:It is possible to compile a custom build of VBSP with these limits changed or removed, but who knows how the engine would respond?

See also