Testbed project exploring the performance of Unity's Job System / Burst compiler combined with GPU mesh instancing (using the DrawMeshInstancedIndirect function, and passing Job System's NativeArrays directly to the shaders as ComputeBuffers).
The functionality provided by this project is slowly becoming obsolete, as the Visual Effect Graph can handle at least an order of magnitude more particles at comparable frame rates.
It's still a good example for basic DOTS data generation & useful for situations where the use of GPU / VFX Graph is not preferred.
Tested on Unity 2022.1.2f1
Currently 2 modes are explored:
- Particle Swarm
524.288 Particles
See it in action - Animated Vector Field
262.144 Vectors
524.288 Particles particles at 60-70 fps
1.048.576 Particles particles at 30 fps
- Add support for HDRP and URP
- [Particle Swarm] Implement spatial binning using the Concurrent NativeMultiHashMap collection.
- [Particle Swarm] Implement flocking / Boid behaviour.
- [Particle Swarm] Implement Unity's ECS (Entity Component System)