Open OfficerYoda opened 1 week ago
It is also possible to use more then one thread for traversal. You could use the already existing thread pool of QuadTree to traverse with four threads at once. Because rendering and physics calculations can't happen at the same time, the thread pool is free during rendering.
The idea is to use two threads.
The first thread is the render thread and is rendering as normal. The second thread is traversing the QuadTree and adding objects to a render queue, which is used by the first thread to render the objects.
This removes the overhead of traversing and rendering in the same thread.