Right, there’s an option that’ve completely forgot.
Although, if the mesh is altered dynamically, I think .DrawMeshInstanced should win by a lot, because it will be a problem to manage all disconnected / reconnected “blocks”.
Creating / destroying meshes aren’t cheap as well.
Although, careful handling of both combining / GPU instancing might be a win / win situation.
Or memory allocs would destroy the performance. Never tried that.
It lags because of what the profiler says. You checked the profiler in hierarchy mode, sorting by time ms of course didn’t you?
You make the mesh out of chunks. Minecraft also uses this approach. It’s a common approach. Then when destruction occurs, you only need to rebuild part of the mesh, not all of it. Adding things like ECS/Burst/Jobs will make it trivial and cost pretty much nothing in performance.
^
What he said.
1 Like
Oh yeah! In my initial reply, I forgot the most important thing of all- always check the profiler when your optimizing. Do that before anything else. Otherwise you may spend days fixing one thing, when the real problem might be something else.