2 ms·
Impressive! Mine linked here starts having trouble at around 2000 units on my CPU. Shows how ridiculously parallelisable this is.
by matsemann 7y ago
Impressive! Mine linked here starts having trouble at around 2000 units on my CPU. Shows how ridiculously parallelisable this is.
- timtimmy 7y agoI love the interactivity in your workshop sandbox. Is the bottleneck your Boid.findNeighbours function? (that was the first thing I tried on the GPU, except GPU parallelism let's us get away with 50,000 boids).
- matsemann 7y agoYup, it's the neighbour function being the problem. And of course updating even more boids, but that just scales linearly, but its noticeable when decreasing the neighbour radius which gives each boid less other boids to adjust to. My neighbourhood implementation is the naive n^2 loop, so it's probably trivial to make it better. Quadtrees, or even just simple caching / zoning would probably allow me to dish out many more boids. It also doesn't help that in order to be easy as a workshop, it's written in a way that's easy to implement, but slow to execute.