This project's goal is to get a hang of Unity, while also learning about the boids (See resources for infos about them), and use them to learn about compute shaders.
Project made with Unity 2019.2.19f1, get it here : https://unity.com/fr. Then open the project with Unity.
This project is not a game, and doesn't have any "play mode" controls, the only way to move around the scene is going into scene mode and moving with the keys binded in your editor preferences (usually WASD).
You can also have fun with the boids behaviour by editing the Cohesion,Attraction and Seperations intensitiy/radius variables and see how the boids react.
Two premade Scenes are available, one with 1000 boids (Warning for lower end pc configuration, may lag serverly), and one with 1000 bois in an aquarium, which keep them in one space (Even tho there still are boids leaks).
- Compute Shaders
-
Multithreading:
- Probably not that interesting considering that compute shaders are just a much better alternative in the case of Boids.
- Unity may not be thread-safe outside of its job system. It could be a hassle to use multithreading.
-
Space partitioning
-
Unity ECS:
- Adds a lot more complexity for a huge performance gain.
(Conrad Parker) Boids Pseudocode
(Craig W. Reynolds) Boids: Background and Update
(Craig W. Reynolds) Flocks, Herds, and Schools: A Distributed Behavioral Mode
(Craig W. Reynolds) Not Bumping Into Things
(Board To Bits Games) Flocking Algorithm in Unity
(Raphael "Shinao" Monnerat) Unity GPU Boids
(Sebastian Lague) Coding Adventure: Boids
###About Unity