Wednesday, November 25, 2009

Binary Space Partitioning

BSP (Binary Space Partitioning) is a method used to divide complex polygons into simple ones in order to increase rendering efficiency. It can even take a volume and subdivide it into planes. The first famous use of BSP was in the Doom engine by id software. Quake later extended BSP with ligtmapping (baking lighting values onto a texture). BSP is still used today and is the crux of many game engines including id tech 5 and Unreal Engine.

Crucial to the rendering of BSP data is the creation of a BSP tree, which iterates through all node ls and sorts them for rendering. Because this, a z-buffer is not required, because nodes are already sorted in depth order. Normally, however, a z-buffer is still rendered an utilized for the seamless intigration of models rendered with tradional methods. Normal models are still used, because BSP is only efficient when using angular and straight figures. Monsters, vehicles, and powerups are normally traditonally rendered. Effects such as particles are also rendered seperately, and composited in through use of the z-buffer.

When using BSP to subdivide volumes, there are two possible methods. One is additive geometry. This method is best thought of as starting out with an empty space and adding volumes of different shapes and sizes. In contrast to additive methods, there is the subtractive type. This is best thought of as starting with a huge block, and carving it into a level by subtracting geometry from it.

Personally, I do not normally use BSP, because I prefer to have full control over a mesh, rather than have to use block-like figures. However, BSP is perfect for indoor levels, or maps with a considerable vertical extent.

No comments:

Post a Comment