Geometry, Brushes and BSP

These three terms goes together when we loosely talk about basic level geometry that's defined by brushes. In current version of Unreal Engine static meshes play important part in shaping the level as well but this article completely abstracts from static meshes and whenever we're talking about shape in this article, only shape specified by brushes is meant.

## Brushes

Brushes are in fact only a recipe how the shape of the level should look and they are not needed for playing the level. When you build your levels geometry and delete your brushes afterwards, level itself keeps the geometry and it's perfectly playable. You run into troubles however when you need to modify your geometry and rebuild it - these are what brushes are for - to define the shape, to define geometry of the level. This applies to additive and subtractive brushes.

Additive brushes add some mass into the level space while subtractive brushes takes the mass out of the level (carves out holes into solid places). Proper order of brushes is important to achieve required geometry (level shape). When the brush is selected you can change the order in contextual menu. You can say for any particular point in the space if it will be void or solid by finding out the last brush that encompasses that point. If it's subtractive - it will be void - and vice versa.

There are also other types of brushes but these doesn't affect geometry or BSP. Many types of brushes used in previous engine versions are now considered obsolete whatsoever.

### Builder brush

Builder brush is a brush that doesn't change the shape of the level - it just shows you the current position and the shape of the brush that you are going to add to your level. You can setup your builder brush by clicking on any of primitive shapes from the respective toolbox. By clicking there with right mouse button you can change predefined dimensions of these shapes. Builder brush can also be edited in Edit Mode - you can edit vertices, cut this brush, etc. Finally you can shape this brush via CSG operations Intersect and Deintersect.

## Geometry

Geometry is just an abstract term that is used when we're talking about a basic shape of the level. Nothing more, nothing less. It's often used in context of "building geometry" (a process where geometry is built in accordance with brushes). Geometry in engine is represented by a BSP tree. That's why you can often see term "BSP geometry". Mostly it doesn't mean anything other than just "geometry". Sometimes explicit usage of "BSP" emphasizes that someone is not talking about static meshes or other ways how to shape a level.

## BSP (Binary Space Partitioning)

BSP is just the method how to divide (3D) space into smaller portions that are easier to describe (convex chunks of space). This space description is stored in a data structure called tree. Hence basic geometry of level in Unreal Engine is described by a BSP tree. In most cases during level design the term BSP is deliberately interchanged with brushes or geometry. When you read "do it with BSP" it actually means that you should create brushes that define geometry that will be represented by a BSP tree later in an engine. You'll hardly need to know any low-level aspects of BSP. BSP is used in many other 3D games.

Using BSP to create geometry brings also some issues in practice. Engines relying on BSP are prone to errors like BSP holes. (Check resources for some links to related articles - for older engine versions though.) However in UT3 you should create much simpler BSP geometry than in previous engine versions. More and more of the level geometry is now created by static meshes which don't suffer from these problems. In order to avoid BSP errors you have to keep your brushes clean and as simple as possible.

So as you can see - without digging into deep theories - all these three words mostly describe "brush-work". Although brush-work is not that crucial how it used to be in previous engine versions you shouldn't underestimate it and you should pay attention working with brushes. Check more on topic in How To keep your brushes clean.

## Resources

BSP Brushes Tutorial on UDN beta
Binary Space Partitioning (BSP) on Wikipedia
Constructive Solid Geometry (CSG) on Wikipedia
BSP errors - article about BSP errors by Hourences (Unreal engine 1 and 2)
HOM hunting - article on solving basic BSP errors by Virgo (UT2004 related)

page revision: 10, last edited: 09 Apr 2008 16:51