Page 1 of 1

How does BSP work?

Posted: Thu Jun 03, 2004 5:06 pm
by Jason210
Hi

Sorry if this sounds stupid or retarded, but I still getting to grips with programming and how his 3D engine works.

I can't afford to invest too much time with Ogre in case it turns out to be incapable of doing the project I have in mind.

The thing that concerns me most is rendering large scenes with loads of triangles. I notice that the no. of triangles in BSP demo increase and decrease as look around, suggesting that rendering of certain areas is switched on and off. Is this done automatically? Do you just drop a huge model with 1million trianges in it and then some kind of occulsion culling takes place?

Sorry for the retared question.

Jason

Posted: Thu Jun 03, 2004 5:24 pm
by jonnii_
bsp is a spacial partitioning algorithm. it will only render what you can see (well just about). if you google you can find lots of information on the algorithm.

Posted: Thu Jun 03, 2004 5:38 pm
by Jeff Leigh
You should also be aware that BSP is only one of many approaches that manage scenes with large polygon counts, and that such 'scene management' plugins have been developed for Ogre which work in many different ways.

Each approach usually requires it's data to be in some specific format. For BSP rendering, you'll quickly discover that it cannot just render from polygon soup, but is limited to geometry constructed with 'brushes' and other BSP-specific concepts. These are not limitations of Ogre, but rather the BSP optimization technique.

If "polygon soup" is your prefered way of modeling, you can look into the DotOctreeScene plugin for Ogre, which renders complex arbituary geometry without the constraints of BSP (but I imagine without a lot of optimizations preventing over-draw as well). There are also a few scene managers optimized for terrain rendering.

Posted: Thu Jun 03, 2004 6:06 pm
by sinbad
The other thing to consider with BSP is that the tools most people use to create the levels (Quake3 / HalfLife etc) cannot be used on commercial projects without paying a license fee. That's why I don't spend much time on the BSP renderer - it's a nice demo, and fun for non-commercial projects, but essentially it's not very useful for 'real' projects unless you can build your own map compilers (not easy), or you're willing to pay iD money.

Many engines major on BSP as their only world format, which I think is misguided since the engine may be free, but the tools are not. Ogre supports any scene format with an appropriate plugin, as pointed out by others here.

Posted: Thu Jun 03, 2004 6:14 pm
by Noiprox
If you're sorry about asking the question here, then obviously you know that this is not the place to ask such a question! Please use a search engine first, then search the forum, then consider posting a question only if it is OGRE specific.

Strictly speaking, BSP can render an arbitrary set of polygons just fine. The constraints are a consequence of PVS optimization, since PVS requires portals.

The way to get an environment managed by the BSP scene manager is to create a Quake3 map, BSP/Vis/Rad/etc. it, and then load it that way. You'll notice this is what both the BSP samples do, and what the documentation very clearly explains. :roll:

If you have poly soup and don't care too much about performance or scalability, you can get generic culling without PVS through a plain octree.

Posted: Thu Jun 03, 2004 7:18 pm
by jacmoe
Noiprox wrote:If you're sorry about asking the question here, then obviously you know that this is not the place to ask such a question!
Be Cool, man. It's not the first time you are providing this as an answer. ...

Try and search for BSP - and you'll probably realize that it's not as easy as it sounds - those who are in the know does not share the knowledge - however, I've dug up an old tut from ye olde mr-gamemaker site (before they went commercial and founded the Game Institute) - actually, it's two tuts: solid bsp and solid-leaf bsp. Pretty thorough. Hard to find (of course)

@Jason210:
I can mail it to you if you want! :) Send me a PM with your email address.
(You will have to have access to windows, though - 'cause the tut-files are in microsoft web archive (.mht) format )

Posted: Thu Jun 03, 2004 11:06 pm
by Jason210
thanks all.

Posted: Mon Apr 18, 2005 8:05 pm
by litobyte
So to code an indoor level engine Ogre suggests to use the OcTree Scene Manager with .mesh complex meshes / .scene ?

Posted: Mon Apr 18, 2005 8:11 pm
by jacmoe
Jeff Leigh wrote:... you can look into the DotOctreeScene plugin for Ogre, which renders complex arbituary geometry without the constraints of BSP (but I imagine without a lot of optimizations preventing over-draw as well). There are also a few scene managers optimized for terrain rendering.
It's the dotscene octree :)

Posted: Tue Apr 19, 2005 4:29 am
by SUFK
sinbad wrote:The other thing to consider with BSP is that the tools most people use to create the levels (Quake3 / HalfLife etc) cannot be used on commercial projects without paying a license fee. That's why I don't spend much time on the BSP renderer - it's a nice demo, and fun for non-commercial projects, but essentially it's not very useful for 'real' projects unless you can build your own map compilers (not easy), or you're willing to pay iD money.

Many engines major on BSP as their only world format, which I think is misguided since the engine may be free, but the tools are not. Ogre supports any scene format with an appropriate plugin, as pointed out by others here.
What about QuArK? Couldn't you use it to make a .map file and then use that as a mesh file? I know that QuArK is released under the GNU GPL, but I forgot what the building tools for Quake 1-3 were released under...... Or even if they did have a license.

Posted: Tue Apr 19, 2005 5:53 am
by jacmoe
You know, that's the problem here, in a nutshell.