Sign in to follow this  
eduwushu

Revisiting the scene graph topic

Recommended Posts

Hi there, I was reading the other day the post of JimH and Yann L about scenegraphs and I want to ask some things that i dont understand very well: In the first example that treats about the use of scenegraphs they applied first a jerarquical organization.Second they applied the spatial criteria. We had a scene with a terrain, a static geometry and the player's character (dynamic entity) who will be running thrugh the scene. The problem to me arises when i start thinking about the static geometry: imagine that we have a village as a single node like the example, internally we have an octree managing the geometry of that node, ¿how is this octree constructed? If we consider the village geometry as a single node ¿does it mean that we are doing the splitting of the village geometry at a polygon-level with this octree? Let's see if i can explain myself better: we have inside the village geometry a house. That house is straddling two cells of the octree. Imagine that we have to do a collision detection only with one half of the house that is in one of this cells. ¿Does it mean that we have to split the village geometry to have the half of the house that interest us taking only the vertices that belong to that half which is inside of the cell? I dont know how are linked the spatial organization of the octree and the low-level geometry. I dont know what is the connection between each cell of the octree and the underlying geometry which it has to organize. What if we have the village geometry as separate nodes each of one represent a single house of the village instead of having one single node to represent the entire village? If we still want to manage the entire village with a single octree... What is the difference from this approximation and the one where we have the village as a single node in the scene graph? What is the best way to do it? And i have another question: if we have a mesh which represents all the village with all of its houses, how we can pass from this mesh to the octree? I dont know if i am thinking too much and im muddling up myself but please ¿can someone explain me all this stuffa little deeper? Im sure that i wont be the only pleased with the answer. Thanks PD: sorry about my english, im doing my best, i need more practise XD

Share this post


Link to post
Share on other sites
mmmm pliz i dont know if my question is too simple or something but i would be very pleased if someone answer me. Im looking for a n answer to this question all through the 495 pages of this forum and is exasperating.
If i find and answer i will put a link to it, meanwhile can someone answer me?

Share this post


Link to post
Share on other sites
i've beeen reading the game programming gems 1 book and i have found wjat i was looking for in the article about octrees that come with it.
But i have stilll the about what we can do if we have the village as separate nodes in the scene graph and later all the village has to be spatial organized.
I think that we can construct an octree above the nodes of the graph that holds in his leaf cells complete entities ( the houses and all of that) instead of storing plygons individually in each cell. It is correct?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Thats one method. There are no rules. You should use a subdivision strategy that suits your games needs.

Note that scene graph usage can go well beyond just the usual rendering and collision detection most often discussed in articles and forum posts. A good A.I. can make extremely heavy use of a scene graph (well beyond what the rendering and collision detection need)

You might want to use an oct-tree for a scene graph that resolves down to the axis aligned bounding boxes of individual object. And then at the leaf nodes of this object graph, another scene graph is referenced to resolve the specific leaf object down to polygon level. The two scene graphs don't have to be the same type. The world -> object graph can be an oct-tree while the object -> polygon graph can be a BSP.

- Rockoon (Joseph Koss)

Share this post


Link to post
Share on other sites
Thanks for your reply, you are right with your answer. I always forget that things arent so rigid as i imagine them, teh problem is that sometimes i have to make a good effort to understand how can work some things. It's maybe because i'm a beginner? ;)
Thanks for your replu again

Share this post


Link to post
Share on other sites
consider one thing. Imagine that you have an outdoor scene with a terrain and an octree that manages tha static geometry at entity-level. We have decided that we wnat an entity that covers a complete village that is placed in the landscape. This village will be managed below at polygon level so we want to use another structure to do this stuff.Supose that we have another octree instead of using a BSP tree.
No w imagine that we are ubicated in the scene far away from the village and we have to change the model of the objects of the village to one less detailed (LOD). We will have then to remove the polygons of that model from the octree that manages the village at polygon level and put the new ones right?It isn't a bit innapropiate in terms of performance that you have to cange those polygons each time the LOD changes?
Moreover imagine that we have something in the village that can be moved at one moment, for example a box that can be taken by our character. (i am thinking that maybe it could be then a dynamic entitie, not static geometry...)How can you reference it inside of the village??

Share this post


Link to post
Share on other sites
for the senerio u describe terrain with buildings a octree is not good youre better off with a quadtree,
also in the quadtrees leafs u normally store ptrs/IDs to the models/meshs and not the actual polygons of the models, thus changimg the models LOD wont affect anything.
the only common reason u want to store polygons in the leafs is if youre doing a raytracer or something similar

Share this post


Link to post
Share on other sites
I think that you havent understand me well, sorry but its difficult to me to express my ideas in english specially when they come to me very quickly. Let's see.
This is teh mesasage i have post in other forum to ask for the same thing i believe that is best written.

Hi there. I have a doubt because im a beginner in engine development and i cant imagine how can be put togueter spatial organization using an octree in an scene graph for example and jierarchical organization of the objects (some objects are linked to parent objects and transform themselves relative to their fathers)
And i have other problem. Supose that we have a scene with an entity like a castle that is composed of many meshes and have a lt of geometry and occupies half of the scene. Imagine that we want to manage that with an octree. We have chosen to put in each cell of the octree the polygons of this big composed entity which are inside the cell so each cell maintains a lis of polygons that are inside it. Imagine that because we have LOD we have to change at a moment the model of one of the entities that are part of the composed 'castle entitie'. This entitie is loaded in the tree as individual polygons. Have we to eliminate the previous polygons of the entity and insert the new ones? Maybe im confusing terms in teh use of octrees?
I know that you can insert complete entities in the nodes of an octree. I f a cell of the octree is visible then the objects partially or totally inside it will be drawn, you can do that as well. But with a large complex entitie like the castle i described it almost always will be visible and you can render it completely because it will affect performance, you will have to render only the visible part of it so you will have to split it going to polygon level?
Am I wrong?
Please im meesing up myself with this issue and i will thank anyone who can answer me. Thanks

Share this post


Link to post
Share on other sites
lets see i have made a wonderful picture in paint to explain it and i have just realize that here is no way to put it in my reply , shit jajajaj XD
Well imagine that we have a secene which represents a egyptian scenary. There is a pyramid some houses an oasis and trees. The pyramid is a very complex model in the scene with many polygons. We are managing this scene with an octree ok? Well we divide the scene in four cell initially and the pyramid remains entirely in one cell. As the pyramid has many polygons we have t divide by four the cell where it is. The cells we obtain have only a part of the p`yramid each one. We continue dividing them until they have a maximum number of polygons or less (thats is the goal of the pctree). ach one of teh entities in the scene as you have said are linked to the cell on which they are, then if the frustum intersects with one of the cell the system will render all the entities that are in the cell. Well, if we put the camera in such a way that the frustum intersect with one of the cells that maintain a part of the pyramid the entire pyramid will be rendered but this is wrong!!! we divided the cells because they have many polygons on it to be rendered all at a time, if teh intersection with one cell implies the rendering oof the complete pyramid the division is useless. So I deduced that i have to maintain in each cell a list with the polygons of the models which are inside of it. But then I have a problem. If teh observer is too far from the pyramid we can use a LOD to minimize the number of polygons in the model and we have to change the model to one less detailed , right?
Normally we have switch nodes in a graph that let you choose the model you want in the traversal of the scene for rendering. But in the octree we have polygons, not entities (remember??)!!! thats my problem. In theory i will have only to switch the pyramid node to choose the model i need en each situation but in my case it also affects the octree. I would have then to take the old polygons and changed them for the new ones. This is not elegant right?
Any idea?? I hope that you understand me now, thanks

Share this post


Link to post
Share on other sites
like i said DONT store polygons in the leafs
(thats how it was done last century, graphics cards have moved on a lot since then, just store the meshID)

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