Jump to content
  • Advertisement
Sign in to follow this  
Norman Barrows

what is a scene graph ?

This topic is 1878 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Advertisement

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

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
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

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

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!