Reputation: 25778
For 3D graphics application, frequently we will use the scene graph to organize the elements into groups and nodes. Scene graph is a tree.
But for rendering efficiency, we also need to use spatial data structure like Octree, R-Tree etc.
I am wondering how the modern system combine those two together? Is there any recommended way?
Upvotes: 1
Views: 509
Reputation: 4411
I am wondering how the modern system combine those two together? Is there any recommended way?
It really depends on the situation and I don't think there's a universal way to do this.
Sometimes using different partitioning structure is a good idea, for instance a simple scene graph that decomposes an object into logically meaningful objects is used for animation and a BVH that only sees a triangle soup is used for rendering.
A system can have different tools; each one of them uses the most convenient structure like a BSP for a level design tool, a kd-tree for light map calculation, portals for real time rendered closed environment then octrees in open spaces.
Combining the same spatial partitioning structure for different things, like collision and rendering can increase performance and reduce memory. However in a modern system, good combinations are often missed because the system uses different middleware and some of them doesn't expose its partitioning structure and keeps it internal.
To build a good system, studying the target application is important, finding a good compromise between complexity, reusability, memory and performance is important. Above all, abstraction is primordial to have a flexible and robust system.
Upvotes: 1