Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GPU Collision Experiment #1604

Draft
wants to merge 3 commits into
base: development
Choose a base branch
from
Draft

GPU Collision Experiment #1604

wants to merge 3 commits into from

Conversation

einarf
Copy link
Member

@einarf einarf commented Mar 4, 2023

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
Copy link
Member Author

einarf commented Mar 19, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant