19-07-2021, 08:27 AM
(This post was last modified: 19-07-2021, 11:00 AM by josemendez.)
Hi there!
The cause for bad performance is simply that you have way too many colliders: every individual lamppost, wall, bush, etc is a ObiCollider in your scene. There's around 2000 of them. Even though Obi uses spatial partitioning to prune out distant colliders and collision resolution for nearby colliders is done in parallel, it still needs to check if they need to have their data copied to raw arrays every frame/copy their data, so that they can be processed in parallel.
This checking/copying is what's eating up most of your time away, as evidenced by the profiler: ObiColliderWorld.UpdateWorld takes 9.69 ms out of a total of 10 ms. (The rope simulation itself is barely visible in the timeline, so simulation is not an issue).
Solution: either limit the amount of colliders present at once (tile your world and only load colliders in the current tile), or merge colliders together. Simply merging chunks into a MeshCollider or a DistanceField will improve performance a lot.
The cause for bad performance is simply that you have way too many colliders: every individual lamppost, wall, bush, etc is a ObiCollider in your scene. There's around 2000 of them. Even though Obi uses spatial partitioning to prune out distant colliders and collision resolution for nearby colliders is done in parallel, it still needs to check if they need to have their data copied to raw arrays every frame/copy their data, so that they can be processed in parallel.
This checking/copying is what's eating up most of your time away, as evidenced by the profiler: ObiColliderWorld.UpdateWorld takes 9.69 ms out of a total of 10 ms. (The rope simulation itself is barely visible in the timeline, so simulation is not an issue).
Solution: either limit the amount of colliders present at once (tile your world and only load colliders in the current tile), or merge colliders together. Simply merging chunks into a MeshCollider or a DistanceField will improve performance a lot.