top of page
Search
Writer's pictureSadanand Naik

SceneGraph

The scene graph, as the name suggests, is a graph structure that is responsible for maintaining the parent-child hierarchy for all objects inside a scene. Each individual game object inside the scene is represented as a node inside this graph which is a child of the root-node representing a particular scene. Each child of an entity is represented as a child node of the node representing the parent entity. Such a structure easily allows the transition of the transformation matrix of the parents to be applied to all their children.


The scene graph constantly checks if any of the parents had its transform changed in the current frame and if it did, then it updates all the transformation matrices of the children with respect to the new transformation matrix of the parent. Below is a code snippet of the update loop of the SceneGraph. It also makes it easy to activate and de-activate entities in the game so that the processes can easily skip unused entities in the game loop.



The check for render component is done so that the scene graph is able to pass a list of updated entities to the dynamic octree being used for frustum culling rendering optimizations.


Possible improvements/updates:

  1. This scene graph, being the first step of the game loop in this engine, could be used to segregate entities for different render passes based on the type of data their rendering component holds.

  2. The passing of updated entities to the dynamic octree could be optimized further.



13 views0 comments

Recent Posts

See All

Comments


bottom of page