Boids
Boids are my favourite hello world for 3D simulation environments. For the last few weeks, I've been using boids to update my GPU programming skills and knowledge of related algorithms in Unity and Unreal.Yesterday I got 0.5 million boids simulating in Unreal Engine at 45 fps on a GTX 1080 [0]. The bottle neck is rendering so many instanced cone meshes, the simulation without rendering can do 1 million boids at 120 fps. I'm borrowing a common data structure used in GPU fluid simulations, the dynamic hashed grid, to calculate the neighbourhood of each boid (cool tutorial here with full source code [1]). We need the neighbourhoods to calculate their urges. My code is a mess at the moment, but if there is interest I can post it to GitHub (Unity and Unreal).Boids are an example of agent-based modelling and swarm systems. I used agent-based modelling in my PhD thesis to construct and simulate realtime, interactive 3D biomolecular models of mitochondria and neuromuscular synapses [2,3]. Now that I'm free (graduated), I'm building an iPad app to teach and communicate structural and molecular biology with immersive, and realtime simulations. Our vision is to make molecular and structural biology immersive and fun. It's not a textbook, it's a little more like Neil Stephenson's young lady's illustrated primer! :D[0]: https://twitter.com/timd_ca/status/1243941167005192192?s=20[1]: https://wickedengine.net/2018/05/21/scalabe-gpu-fluid-simula...[2]: https://prism.ucalgary.ca/handle/1880/111493[3]: https://youtu.be/6CsxADBpal0