This project is a starting point using compute shaders to do physics simulation in UE5. It implements a 1000 particles collsion simulation in the GPU.
collision.mp4
1. simlation method
I use Discrete Element Method(DEM) to simulate particle collision.
2. Accleration method of neighborhood search
- I'm using a hashed grid to accelerate the neighborhood search of particles.
- Be sure that the particle size must be smaller than the grid size.
- For detailed hashed algorithm, you can look into the refrence tutorial.
3. TODO
- Use prefix sum to accelerate neighborhood search.
- Use UInstanceStaticMeshComponent to speed up the rendering.