What is a good practice for 2D scene graph partitioning for culling?
- by DevilWithin
I need to know an efficient way to cull the scene graph objects, to render exclusively the ones in the view, and as fast as possible.
I am thinking of doing it the following way, having in each object a local boundingbox which holds the object bounds, and a global boundingbox which holds the bounds of the object and all children.
When a camera is moved, the render list is updated by traversing the global boundingboxes.
When only the object is being moved, it tries to enlarge or shrink the ancestors global boundingboxes, and in the end updating or not the renderlist.
What do you think of this approach? Do you think it will provide a fast and efficient culling?
Also, because the render list is a contiguous list, it could accelerate the rendering, right?
Any further tips for a 2D scene graphs are highly appreciated!