Hello,
I would like some advice for my "home-made" cell/portal, I'm using BSP for the mesh, textures, lightmaps and entities.
Well, I think I should call it "semi-BSP" since I don't use the nodes, leaves, VIS, and the other invisible stuff at all.
To define a zone, I simply fill a room with a big brush having a ZONE texture on it.
The game will take the BBox coordinates of each ZONE box, then create a separate StaticGeometry by putting each face inside it with the ManualObject class.
I realized that the rendering speed is higher when I create an Entity for each face (500FPS) than creating the Entity for the whole zone at once (280FPS).
Is it safe ? Does it consumes a lot of memory ?
The highest FPS I get when I don't see anything is 1300.
How can I know if the game could be slow or well optimized ? Is 600 FPS nice ? Should I be worried when I get 250 FPS ?
Here is a little problem, in this picture, I should render only the zones I can see. Well, as far as I know, Ogre can basicly do frustum culling, maybe it would render a node if it's at least in the field of view like that :
Every zones would be rendered then in this case.
Should I try to implement a visibility algorithm like Hardware Occlusion Culling ? Maybe trying to use the original Quake 3 PVS again ?
I've just thought about making a "config" file for the portals, describing the only zones to render when we see a portal, for example, if I am in Zone1, I would be able to render the Zone 2 only.
If am I in Zone2, it would be possible to see the bottom Zone, Zone3 and Zone4 if we can see the Zone3's portal to Zone4... Is it good ?
If I encounter such a situation :
What would be the best method to cut the faces with the zone's bounding box ?
The faces would be rendered outside the zone, or even worse : another zone would "steal" the faces if the object is inside multiple zones.
Thanks for replying, I would like to make some important and basic things very clear for me, 3D programming is not something I do everyday.
Advice request
-
- Gnoblar
- Posts: 7
- Joined: Mon Feb 27, 2012 12:31 pm
Advice request
Last edited by kaugit on Sun Mar 04, 2012 11:48 am, edited 1 time in total.
- johnhpus
- Platinum Sponsor
- Posts: 1186
- Joined: Sat Apr 17, 2004 2:49 am
- x 3
Re: Advice request
I'd suggest revisiting that issue. That sounds completely opposite from everything I've heard. Typically, fewer larger meshes will render faster than hundred of smaller meshes.I realized that the rendering speed is higher when I create an Entity for each face (500FPS) than creating the Entity for the whole zone at once (280FPS).
As for your scene graph... are you doing this just for the exercise, or is there a reason not to use Ogre's octree scene manager?
-
- Gnoblar
- Posts: 7
- Joined: Mon Feb 27, 2012 12:31 pm
Re: Advice request
Thanks for the hint johnhpus,
I've done some comparisons between adding each face to the staticgeometry and building the whole level into it, I get almost the same result as 300 FPS, I was thinking about "if I put an entire mesh, it would certainly draw the other faces when I don't see them".
Sorry, I've forgot to mention that I'm using OctreeSceneManager, is it a magical one ? I just load it and do nothing special about it.
So, I suppose that I just can continue to load the whole level into a single mesh, put it into a staticgeometry and it will be really enough ?
Wow, I've really thought it would be harder than that, very impressive.
Thanks a lot, and best regards!
I've done some comparisons between adding each face to the staticgeometry and building the whole level into it, I get almost the same result as 300 FPS, I was thinking about "if I put an entire mesh, it would certainly draw the other faces when I don't see them".
Sorry, I've forgot to mention that I'm using OctreeSceneManager, is it a magical one ? I just load it and do nothing special about it.
So, I suppose that I just can continue to load the whole level into a single mesh, put it into a staticgeometry and it will be really enough ?
Wow, I've really thought it would be harder than that, very impressive.
Thanks a lot, and best regards!
- johnhpus
- Platinum Sponsor
- Posts: 1186
- Joined: Sat Apr 17, 2004 2:49 am
- x 3
Re: Advice request
The octree scene manager does some culling for you, and you're right that you don't want to use a single enormous mesh so that you don't lose the benefits of that culling. There is likely a sweet spot between "all one mesh" and "each face is a mesh", and I would seek that out.
I should point out that I haven't used static geometry is forever (since before it was officially in the main Ogre distribution), so it may be that Ogre is chopping up your massive mesh or otherwise taking care of it for you, and that might explain the lack of speed difference between many tiny meshes and one giant one (that is, Ogre's static geometry may be turning them into more or less the same thing, I don't know).
I should point out that I haven't used static geometry is forever (since before it was officially in the main Ogre distribution), so it may be that Ogre is chopping up your massive mesh or otherwise taking care of it for you, and that might explain the lack of speed difference between many tiny meshes and one giant one (that is, Ogre's static geometry may be turning them into more or less the same thing, I don't know).
- Kojack
- OGRE Moderator
- Posts: 7157
- Joined: Sun Jan 25, 2004 7:35 am
- Location: Brisbane, Australia
- x 534
Re: Advice request
From your diagram, what you want is the pcz (portal connected zone) scene manager. It allows you to split the world up into zones and define the portals between them. It only renders a zone if the portal into the zone is visible. In your pic, only the starting zone and zone 2 would render, because the doors connecting to zone 3 and zone 1 aren't visible through the door to zone 2.
I've never really played around with it, so I can't say anything about how to use it, but that's how it's supposed to work.
I've never really played around with it, so I can't say anything about how to use it, but that's how it's supposed to work.