Sign in to follow this  
Promp

Scene manager things in 3D games

Recommended Posts

When reading about 3D games I keep hearing about things like octrees, bsps, portals, scene graphs, etc. I'm not quite sure what they're for though. I've read somewhere that they're used to check what objects are visible for rendering. Is that *all* they're used for? I think I've also read about them being used for collision detection, but what if I'm using a physics library like ODE that already does collision detection?

Share this post


Link to post
Share on other sites
It's a good question, I don't know why you didn't get any replies. Perhaps you should've posted it elsewhere, because it's not an easy beginner question.

Anyway, most of the statements you've made are close to the truth as far as I know. They're mostly for discarding things that aren't visible from ever being rendered. I guess they can be used for some other similar tasks too (including collision detection, figuring out if 2 plays can 'see' each other, etc.).

About the ODE library doing its own collision handling, that's a good question too and I'm not sure. I guess it depends on how ODE does it. Perhaps then you don't need to use your BSP for that. Or maybe you can use them both.

Share this post


Link to post
Share on other sites
octrees:
An octree is a special kind of (search)tree. There are binary trees (searching in 1D), quad trees (searching in 2D) and oct trees (searching in 3D). They could be used to get a certain set of i.e. objects in a certain area (box) quite fast. You could use them to access your game entity(gamelogic), to cull objects(rendering), or to get a collision partner(physics).

bsp:
Bsp stand for binary space partition. Most often they are used for culling static meshes in a level in the times of doom, quake and unreal. I don't think that they are quite popular these days where the number of faces in a mesh increased quite fast.

portals:
Portals often refer to portal engines. This is rendering culling method for mostly indoor levels. Portals could be used easily in combination with one of the other techniques.

scene graph:
Like the name says, this is a representation of the scene as a graph. Its not only about culling but about the rendering order. Certain surfaces(materials) have to be rendered in a certain order to look right(think about a water, which have to be rendered after the rest of the scene has been rendered first).


Most libraries (graphic,physics) use their own highly optimized data structure to do their job quite fast. You could use one or all of these data structures or you could create your own additional structure for your own propose (i.a. game logic). I would suggest to use some kind of octtree for your own propose, because it is quite easy, powerful, useful and general enough to be used in physics, audio, gamelogic, graphics. It is absolutly ok if some other lib use some other data structure doing something similar, it most likly will not kill your performance (other things will do this first ;_) )

--
Ashaman

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this