arcade icon indicating copy to clipboard operation
arcade copied to clipboard

GPU Collision Experiment

Open einarf opened this issue 2 years ago • 1 comments

Experiment supporting GPU collision checking in the Spritelist. This has nothing to do with the spatial hash. Ignore the branch name.

  • The idea is to write the original untransformed hit box into a floating point texture.
  • The shader will have access to all the sprite properties for free and can (on the fly) transform the hit box points and do polygon intersection (really just line intersection checks).
  • Running this collision check is of course expensive, but it completely eliminates the need for sprites to calculate adjusted hit box points and dealing with a spatial hash.
  • Spritelists with this collision type will have a much lower capacity. Possibly 1024 as a cap.
  • Another challenge is that the user needs to pre-determine the max number of hit box points the sprites have. We can assume 4-8 points if the simple hit box algo is used for now.
  • This collision type is better suited for spritelist vs spritelist collision (collision with self or other list)

einarf avatar Mar 04 '23 00:03 einarf

Will rremporarily retire this experiment in favor of the rust acceleration. We can experiment more with this later in 3.0.

einarf avatar Mar 19 '23 04:03 einarf