Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help  High variance in ObiFixedUpdate performance impact
#2
Performance can vary depending on what's in the scene, how close the rope is to potential colliders, even the speed of the rope particles. Obi's broad phase works using two multilevel grids: one for colliders, another for particles.

- Each step, Obi checks whether any collider has changed its bounding box. Any colliders that have changed are removed from the collider grid and reinserted in any cells it overlaps. Colliders that do not move are not updated.

- Each step, a list of particles that have moved from one cell of the grid to another one is constructed. They are removed from their old cell and inserted in the new cell. Particles that haven't moved between cells are not updated.

This way, both broad phase structures (grids) are updated incrementally, but the cost increases with the amount of moving particles/colliders. Once both structures have been updated:

- For each cell in the particle grid, a bounding box is calculated that envelopes the particles and their velocity vector. Then, this bounding box is tested against the colliders grid. Contacts are generated between the particles and All colliders in the cells overlapped by this velocity-bounding box.
So, fast moving particles generate more contacts (as they can potentially have more collisions in a single step), and are smore costly.

With this in mind, imagine a scene full of colliders around a swinging pendulum-like rope: When the pendulum swings from left to right, the velocity of the particles is higher, and more speculative contacts will be generated against the surrounding colliders. At its lowest kinetic energy point (maximum potential energy), the pendulum has very little to no velocity, and almost no contacts will be generated.

Also, timestep length has an impact on this: lower timesteps result in smaller position deltas, so less performance variance.

Do you get the same variance if you disable collision constraints completely?
Reply


Messages In This Thread
RE: High variance in ObiFixedUpdate performance impact - by josemendez - 14-04-2020, 03:00 PM