Skip to content
This repository has been archived by the owner on May 23, 2021. It is now read-only.

CPU and GPU implementations of Craig Reynold's boids in Unity.

License

Notifications You must be signed in to change notification settings

danielshervheim/unity-flocking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flocking in Unity

A Unity implementation of Craig Reynold's boids.

gif

20,000 boids simulated entirely on the GPU, running at 60 fps (watch on Youtube).

About

Includes CPU and GPU implementations.

Both are naïve O(N2) implementations. The CPU version can handle about 150 boids at 60 fps, while the GPU version can handle about 20,000. (As tested on a Ryzen 5, Nvidia GTX 1060 machine. Your mileage may vary).

The GPU version requires a graphics card that supports Compute shaders and GPU instancing in Unity.

The CPU version includes a script to visualize some of the parameters of the boids. (Nearest neighbors, forces, and path over time).

To-do

  • Implement vertex animations for swimming fish and flying birds.
  • Improve performance with some kind of spatial data structure.
  • Add environmental awareness / obstacle avoidance.

About

CPU and GPU implementations of Craig Reynold's boids in Unity.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published