Sign in to follow this  
Norman Barrows

what is a scene graph ?

Recommended Posts

Norman Barrows    7179

thanks for the info.

 

i had heard of them with respect to vector drawn graphics packages, but only once with respect to nested transformation hierarchies as far as games goes. So i was constantly looking at some type of list of drawables or list of renderables and going "is that a scene graph?".

 

looks like the data structure i'm interested is a "list of renderables", as opposed to some sort of BSP octtree "world / level map".

Share this post


Link to post
Share on other sites
Ingenu    1629

In 2007 I wrote a series of articles (that really need an update) about 3D engines, in which I talk about SceneTree, SpatialGraph & RenderingQueue...

http://www.beyond3d.com/content/articles/98/

http://www.beyond3d.com/content/articles/102/

http://www.beyond3d.com/content/articles/109/

 

(Although they got published over time I wrote the whole series in a week-end in September 2007.)

 

I hope it will help you.

Share this post


Link to post
Share on other sites
cozzie    5029
My definition/ how I implemented it in my engine is:

- indexing everything in the 3d scene
- having indices on meshes, mesh instances, materials, effects etc
- sorting and indexing them in a way that I can render the scene with minimal buffer/material/texture changes and state changes

My scenegraph also takes care of sorting alpha blended mesh instences, culling visible point lights affecting mesh instances etc.

@ingenu: thanks, good stuff for reading and gaining more knowledge/ freshening up

Share this post


Link to post
Share on other sites
mogumbo    133

It's a graph that describes a scene. The word 'graph' is used in the mathematical sense. I think in the case of a scene graph it is usually (or always?) a directed acyclic graph.

 

The graph is just the data structure for holding all the scene data. The main things you want to achieve with it are view frustum culling and state sorting because those will make rendering *much* more efficient. These are done by all the helper routines that operate on the graph. A good scene graph will come with a lot of extra helpers, such as level-of-detail switching, depth sorting for rendering transparent objects, shadow map rendering, etc...

Share this post


Link to post
Share on other sites
lipsryme    1522

Pretty much what has been said before but maybe to show it in a more "visual" and direct way:

As an example of how the structure (and also most importantly the transformations) of a character or skeleton might look like:

 

Root (could be just an origin location in the center somewhere)

    -> Torso

              -> Head (is relative to the torso)

                        -> Left Eye (is relative to the head)

                        -> Right Eye

                         ...

              -> Left Arm

                         ...

              -> Right Arm

                        ...

              -> Left Leg

                        ...

              -> Right Leg

                        ...

 

 

So we can easily build a dependency structure that holds our skeleton together.

You could then define the Head's transform relative to the torso's transform which is also relative to the root's transform (location)

e.g. 

global_head_transform = * global_root_transform * global_torso_transform * global_head_transform

hope I got the order right...

Edited by lipsryme

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