Our application relies on using MeshColliders with large procedural meshes. Because it is VR, the baking time can cause some noticeable frame spikes.
Essentially I just want to throw the idea out into the wind that it would be great to be able to baking the collision data in the background and activate it after a short delay. I believe this is possible because you can transform mesh colliders without fully rebaking the data.
deus0
Jan 25, 2018 13:39
Optimizations for Procedural games are super imported for me :)
JohnMOlsen
Dec 20, 2017 17:11
Backgrounding it may not be the best method since you could flood the system with threads by starting a new update faster than it can finish.
Better would be a way of replacing this:
_collider.sharedMesh = _updatedMesh;
with something like this:
_collider.UpdatePartialSharedMesh(_updatedMesh, fromX, fromY, toX, toY);
If I only change a tiny section or even a single cell of a 100 x 100 mesh, there's no reason to rebake the whole thing and cost me 40 ms.