Archived

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

Fidelio66

Is CSG neccesary for BSP ?

Recommended Posts

Maybe a stupid question, but for making a bsp from a level, is the csg process really neccesary ? I don''t mean making quake3/HL levels but a custom design for my own game. The downside of the CSG process is that it splits your faces where another block (brush) touches it. So if you have a floor and you put a pillar on it, it splits up the floor into many pieces. If you just build a BSP to separate solid space from empty space, just for collision, do you need it ? Assuming your level editor doesn''t work like unrealed, where you can specify additive and subtractive brushes and the editor/compiler creates the level from this, but only use solid brushes and no carving like in worldcraft/radiant I assume you can work with the brushes as they are, even if they intersect. It looks to me the CSG process is mainly for the faces, to generate smaller faces that fit as delimiters of each leaf. Or am I overlooking anything ?

Share this post


Link to post
Share on other sites
quote:

"The downside of the CSG process is that it splits your faces where another block (brush) touches it"



True, but you don't have to use the spilt faces when rendering. After you've built the bsp tree, throw away the split faces and put the original ones back in it's place. Just make sure when rendering, you flag the faces so you don't redraw them more then once. This is because some leafs will be sharing the same faces.

[edited by - MagTDK on January 5, 2004 8:42:42 AM]

Share this post


Link to post
Share on other sites
It depends on which kind of BSP you use. A quake1 bsp where polygons are split and which is used for front-to-back rendering and where every leaf contains exactly the polygons that bound the cell will probably need it. But more modern techniques like Q3 don''t split polygons that span planes, they just add them to both sides.

I want to separate the graphics from the collision detection. In other words, I have generated faces from intersecting the planes of the brushes, without CSG. Now I want to build a BSP tree of the solid brushes for collision detection. This will split the open space into convex regions. I will then do some kind of recursion and add a zone number. zone 0 will be all nodes connected to the origin or playerstart through open air and without going through a (hand-placed) portal brush. Then I''ll pick an unused leaf, assign this zone 1 and repeat the process.
When this is done I will assign faces to zones, sort them by texture and save the vertex/index data.

So a room is a zone and everything in it is one object/mesh.

In the game I''ll load them into VB/IB pairs, and draw them per texture per zone, to take advantage of the speed of modern cards, no separate draw per face like Q3 does. The BSP is only used for collision.

ANy thoughts/comments ?

Share this post


Link to post
Share on other sites