Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug / Crash  Overlapping Obi Colliders too much causes the Compute backend to go mental
#3
(Yesterday, 10:58 AM)josemendez Wrote: Particles in the compute backend have a hardcoded limit of 32 potential contact pairs each. Once you get past this amount of potential contacts, particles will start to randomly drop contacts every frame. This means they may drop their contact against the floor for a few frames, then get launched upwards next frame when they do keep the floor contacts but decide to drop different contacts. Which contacts are dropped and which ones are kept is decided essentially at random, since it depends on the order in which threads are executed as they find and append potential contacts for further processing.

Note that this limit affects potential contacts (not actual contacts/collisions). This is why particles will act up when they're merely near a crowd of colliders, even if they don't touch them.

Ah-ha, that makes sense! So it splits the game world up into cells and if there are too many potential contacts in a cell it will start to randomly drop contacts, including existing contacts like the floor. That explains why the problem got gradually worse as I added more colliders, increasing the limit to 64 solved my issue. Reading through the ColliderGrid compute shader now, I have a few more questions if you have time:

  1. What counts as a potential contact? Is it an entire collider, or a collider vertex, or a face? would boxcolliders, for example, use up fewer potential contacts?
  2. How does it determine where the grid starts and the size of the grid cells? Is it centered on the Solver, and so should I aim to put the solver in a central location to my level?
  3. Any idea roughly what the memory impact of increasing the contact limit is? And this may be a stupid question but I just want to make sure I'm not getting it wrong, is it storing the data in VRAM or RAM?
The fact that I've hit this limit probably indicates that I may be taking a less than ideal approach to collisions. In my game I have 1 floor collider that spans the entire map and then the corridors made out of modular walls slotted together, where each wall has an Obi collider, and then there are various objects randomly placed that also have Obi Colliders. They're almost all box colliders, with just a few mesh colliders. Do you have any recommendations for optimal approaches to collision to reduce the number of potential contacts?
Reply


Messages In This Thread
RE: Overlapping Obi Colliders too much causes the Compute backend to go mental - by Nyphur - Yesterday, 01:09 PM