To main page |

Scene Graph

Scene graph is a representation of the scene (or world) to be rendered into a form of a tree, where descendants in the tree inherit properties from their parents.

In simple words

For example you can arrange a "book" to be a descendant of "table" and therefore if you rotate table 45 degrees, the book is automatically rotated with the table. But remember that you have to specify the position and rotation of the "book" RELATIVE to the "table", not to absolute world coordinates.

If you arrange "house" to be a parent of "table" and use occlusion culling algorithm, and "house" is hidden, all of it's descendants, that are inside of his bounding volume is considered hidden too.

OpenGL doesn't have a scenegraph implementation, you either have to implement it yourself, or use one of the available alternatives:

Examples of scene graph implementations

* NVIDIA Scene Graph
* OpenSceneGraph
* OpenSG

Why scene graphs are bad idea

Generally scene graphs are a good idea, but in reality during the game development you can stumble into a problem where you have a single root and thousands of nodes with no children (because, well, table isn't actually a "child" of a "house", it's a separate entity and there aren't that many entities that can be arranged into a tree). This mostly negates the positive effects of scene graph.