Falcor
2005.07.15, 01:49 PM
Hello,
I'm trying to add a scenegraph to my engine and want to make sure my understanding of it makes sense. I've read all the articles on gamedev and looked at ogres code mostly.
So the scenegraph itself is mainly to denote hyrarchy and group objects together. Every node can have a material attached, a mesh, a light, a shader program, etc. To update the scene a traversal goes through and calls update on every node which will update the animation associated with the node. On a rendering traversal, it will keep track of the absolute position matrix as it goes down and set each nodes absolute matrix, resetting it to the parents matrix for each new child. With its absolute matrix, every node adds itself to some rendering queue and adds any lights to the rendering state. The renderer then sorts the queue by the material / shader programs and uses their mesh as a vertex array with the associated material properties. Or should it let every model have its own drawing function and draw themselves? Does this make sense or have I got it all wrong?
-Thanks
I'm trying to add a scenegraph to my engine and want to make sure my understanding of it makes sense. I've read all the articles on gamedev and looked at ogres code mostly.
So the scenegraph itself is mainly to denote hyrarchy and group objects together. Every node can have a material attached, a mesh, a light, a shader program, etc. To update the scene a traversal goes through and calls update on every node which will update the animation associated with the node. On a rendering traversal, it will keep track of the absolute position matrix as it goes down and set each nodes absolute matrix, resetting it to the parents matrix for each new child. With its absolute matrix, every node adds itself to some rendering queue and adds any lights to the rendering state. The renderer then sorts the queue by the material / shader programs and uses their mesh as a vertex array with the associated material properties. Or should it let every model have its own drawing function and draw themselves? Does this make sense or have I got it all wrong?
-Thanks