Blog

Archive
| All posts |
  • Plane9 Scenegraph

    published on 11/1/2009 12:35 PM

    For the next release of Plane9 I wanted to add light support. Currently all scenes look plain and the lack of any form of lights is big part of this. To do this I have been forced to redesign the engine a bit. Before each node just called any connected nodes to get the data from them and then it did what it had to do with that data. That setup wasn't made for lights since lights needs to accessible from all nodes. This is because we need find the closest lights and use only them. The solution has been to dynamically create a scene graph each and every frame. This is something most other engines dont have to do since they load in a level and that's all the data they need. But for Plane9 a clone node can from one frame to the next create a lot of new nodes that must be added to the scenegraph.

    It took some doing but there is some very nice advantages with this

    • Frustrum culling is possible
    • Meshes using the same effect are grouped together
    • Global objects like lights are possible and with them bumpmapping and other such shader effects
    • All node positions are only calculated once instead of once per render window

    The creation of the scene graph is very fast since it uses cached object so its basically just walking though the connected nodes.

    I also noticed that since Plane9 was added to the Winamp plugin directory, less than one month ago, it has been downloaded over 10000 times!