Cell and portal scenes and level geometry
Posted: Mon May 23, 2011 8:03 pm
Hello everyone, my searches on this topic have proven fruitless, I apologize if it is my searching skill that is lacking!
I hope someone can give me some insight!
I have a small 3d game in development. The typical scenes will be indoor, room and corridor areas similar to a lot of FPS games. After reading about various options, I've gone with a cell and portal design for my overall scene management (similar to the portal connected zone manager in Ogre). Each cell uses a loose octree for internal space partitioning. This seems to work very well for managing visibility, rendering, and collision of objects in the cells (discreet mesh objects that can move around)
My question is, how is level geometry typically handled in a structure like this? By level geometry, I mean the walls and floors (and other static polygons that make up the boundaries of a room). Currently, the geometry of each cell comes in (from blender) as a series of polygons sorted by material so that they can be rendered with a minimum of state changes on the graphics card. For rendering, this seems to work just fine -- I can just sequentially draw all visible cell's level geometry fairly quickly.
But, I want to utilize my octree to be able to efficiently find level geometry for collisions and such, and potentially cull parts of a cell that aren't visible. Material sorted poly meshes are often very broad, with a combined bounding box that spans most of the cell (for instance if all the walls are the same wood-paneled texture--- this gets even worse if I start using texture atlases). This means that for collision (or visibility ) checks, almost the entire cell would be returned each time if I tried to simply drop the polygons as a whole into the octree. This seems wrong to me, so I'm wondering if there's a good way of representing this level geometry in a cell and portal structure that I'm missing.
My current debate is between
- Leaving level geo as it is, and just brute force all collision/visiblity checks with level geometry. It might be simple enough that trying to handle it with my spacial partitioning is overkill that won't pay off.
- Duplicating the geometry -- sorting polys into material groups for rendering, and somehow partitioning the geometry into manageable hunks for collision detection. For this, how would I split them up? By octree planes? at which subdivision level?
- split all level geometry into chunks based on octree partitions for both rendering and collision. Again, not sure how finely to split them up.
- something else? how do people do this? all the things that I've read seem to skip over this point as if it is obvious
Any thoughts? I feel like I'm stuck on this, and it seems like it should be trivial...
PS. I should note that I'm not using Ogre for this, but it looks as though my design is pretty close to how Ogre's scene management works, so I wager Ogre geniuses have some advice that would be very pertinent.
Thanks,
Kalie
I hope someone can give me some insight!
I have a small 3d game in development. The typical scenes will be indoor, room and corridor areas similar to a lot of FPS games. After reading about various options, I've gone with a cell and portal design for my overall scene management (similar to the portal connected zone manager in Ogre). Each cell uses a loose octree for internal space partitioning. This seems to work very well for managing visibility, rendering, and collision of objects in the cells (discreet mesh objects that can move around)
My question is, how is level geometry typically handled in a structure like this? By level geometry, I mean the walls and floors (and other static polygons that make up the boundaries of a room). Currently, the geometry of each cell comes in (from blender) as a series of polygons sorted by material so that they can be rendered with a minimum of state changes on the graphics card. For rendering, this seems to work just fine -- I can just sequentially draw all visible cell's level geometry fairly quickly.
But, I want to utilize my octree to be able to efficiently find level geometry for collisions and such, and potentially cull parts of a cell that aren't visible. Material sorted poly meshes are often very broad, with a combined bounding box that spans most of the cell (for instance if all the walls are the same wood-paneled texture--- this gets even worse if I start using texture atlases). This means that for collision (or visibility ) checks, almost the entire cell would be returned each time if I tried to simply drop the polygons as a whole into the octree. This seems wrong to me, so I'm wondering if there's a good way of representing this level geometry in a cell and portal structure that I'm missing.
My current debate is between
- Leaving level geo as it is, and just brute force all collision/visiblity checks with level geometry. It might be simple enough that trying to handle it with my spacial partitioning is overkill that won't pay off.
- Duplicating the geometry -- sorting polys into material groups for rendering, and somehow partitioning the geometry into manageable hunks for collision detection. For this, how would I split them up? By octree planes? at which subdivision level?
- split all level geometry into chunks based on octree partitions for both rendering and collision. Again, not sure how finely to split them up.
- something else? how do people do this? all the things that I've read seem to skip over this point as if it is obvious
Any thoughts? I feel like I'm stuck on this, and it seems like it should be trivial...
PS. I should note that I'm not using Ogre for this, but it looks as though my design is pretty close to how Ogre's scene management works, so I wager Ogre geniuses have some advice that would be very pertinent.
Thanks,
Kalie