Archived

This topic is now archived and is closed to further replies.

eagleboy

bsp brushes

Recommended Posts

Hi, I'm at the point where I'm looking to create a q3 bsp renderer. I understand bsp trees (both node and leaf based) in gerenal, however I'm confused by the notion of brushes. What exactly is a brush and what is it used for? How is it used? Thanks for any tips, eb. [edited by - eagleboy on July 17, 2002 11:39:52 PM]

Share this post


Link to post
Share on other sites
Brushes define 3D objects in your world. The concept of a brush doesn''t even make sense in terms of a BSP tree. Their only purpose is to aid the level designer in building the world. Would you rather build a level using a series of planes or 3D objects? 3D objects are easily for everyone to deal with. That''s why you have some other tool before the BSP tree builder that takes the brushes and converts them into faces and planes, something which the BSP tree knows about. CSG (Constructive Solid Geometry) might be a term you recognize. If you like Half-Life, you can download Zoner''s Compile Tools, which handle the compilation of a HL level. They are very useful as learning materials.

Share this post


Link to post
Share on other sites
So why then are they handled differently in the context of a q3 level? In your scenario wouldn''t the polygons that make up these models simply be inserted into the global bsp tree? Surely there is a reason for the distinction between world elements and brush elements.

eb.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster

The brushes in a Q3 BSP are only for collision detection. For rendering, you use the ''faces'' lump.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Yea, you get all the raw data you need, all you need to do is draw it and forger about brushes.

Share this post


Link to post
Share on other sites
What exactly is a brush?

A brush is a convex polyhedron, defined by a set of planes. Each plane is defined by a set of 3 points, which need not be on the faces of the polyhedron.


How is it used?

Level designers build maps from brushes like lego blocks. When a map is compiled, at least in Quake engine games, brushes are tesselated, and those triangles are stored, and this is what is sent to the graphics card. However, brushes are also entered into that file, because their representation is ideal for collision detection.

Share this post


Link to post
Share on other sites
I didn''t use brushes at all for mine (not yet anyway, I''m having a look at them now to see if its worth it). For the collision I just did ray/polygon collision with the faces in the same leaf as the camera. It might have some problems with things like water though so I might need to use brushes after all

Share this post


Link to post
Share on other sites