Closed kazimuth closed 9 years ago
Actually, the most time consuming part of the meshing can pretty easily be put into a separate thread. It doesn't need any connection to Unity for it. It's only applying the mesh to the gameobject, but that's instant. (ish)
29a1f87
I'm doing a little profiling, and currently the call to
RemoteClient.suspend_game()
fromGameMap.Update()
is taking up 6-25ms most frames.GameMap.GetBlockList()
also takes 2-3ms.Running these on a background thread could speed up the main thread a lot. Any results could be put into a queue to be processed by the main thread, so that it doesn't have to wait.
It might even be possible to compute meshes on a background thread, at least the vertices / edges for the blocky parts of the world - it wouldn't be possible to copy existing meshes, though, because no Unity API in other threads.