
Thinking Parallel, Part I: Collision Detection on the GPU (2012) - setra
https://devblogs.nvidia.com/parallelforall/thinking-parallel-part-i-collision-detection-gpu/
======
Animats
Coarse collision detection is only expensive if done from a cold start every
time. In practice, there's a startup cost of ordering the bounding boxes, but
then only a small incremental cost as things move around. Most moves are
local, and require only a small number of changes, and many objects in a game
don't at all. Here's the classic paper from Ming Lin, from the 1990s.[1]

Fine collision detection can also be done incrementally. Incremental GJK is a
good approach. Here's Steven Cameron's paper on that.[2]

I wrote one of those once in C++, using the ordered bounding box approach from
Lin and the incremental GJK approach from Cameron, plus some new stuff to
guarantee continuity as objects moved. It turns out that incremental GJK has
some serious floating point loss of significance problems as faces approach
parallel. When you build a physics engine this way, the near-parallel case
gets explored very thoroughly as objects settle. Turns out you need a 64-bit
FPU. This was a problem on some consoles, and is still a problem on some GPUs.

[1]
[https://www.cs.jhu.edu/~cohen/Publications/icollide.pdf](https://www.cs.jhu.edu/~cohen/Publications/icollide.pdf)
[2]
[https://graphics.stanford.edu/courses/cs468-01-fall/Papers/c...](https://graphics.stanford.edu/courses/cs468-01-fall/Papers/cameron.pdf)

~~~
nice_byte
Is gpu based collision detection at all common in modern games?

~~~
maccard
No, practically unused. The GPU is normally fully used for rendering in modern
games.

~~~
ocharles
Is there any evidence you can provide for this? I don't necessarily dispute
it, but I don't entirely buy that it's _just_ for rendering - I thought some
games were starting to offload particle systems and physics.

~~~
tlarkworthy
Unity physics engine uses only CPU implementation of PhysX.

[https://blogs.unity3d.com/2014/07/08/high-performance-
physic...](https://blogs.unity3d.com/2014/07/08/high-performance-physics-in-
unity-5/)

~~~
ramy_d
Same goes for UE4
[https://youtu.be/-lFKZRX1K_0?t=190](https://youtu.be/-lFKZRX1K_0?t=190)

