What?

Simulating slime mould in real-time, producing outstanding organic-like images and animated movies.

Inspiration

We were absolutely mesmerised by the video Coding Adventure: Ant and Slime Simulations from Sebastian Lague on YouTube.

In our research, we came across others who have considered more practical applications for similar systems of slime mould including work by Tero et. al. [1], who used slime mould to model Tokyo's rail system.

[1] Tero, Atsushi, et. al. (2010). "Rules for Biologically Inspired Adaptive Network Design." Published in Science.

How?

Our main computation-heavy work is handled by OpenGL compute shaders, with Python code as the glue in between, using the moderngl graphics library. Using compute shaders allows us to parallelise up to 100,000 agents at the same time on a laptop! During testing we mostly were using integrated graphics, which gives much more room for more complex simulations on dedicated graphics.

Accomplishments

  • Developing a compute shader in OpenGL (without Unity!)
  • Achieving natural-like behaviour.
  • Implementing a custom agent and blurring algorithms.

Learning

  • We learnt a lot about the OpenGL pipeline, which many of us were new to.
  • Lots of work was done towards image processing, which was unfortunately not able to be included in the final product.

Challenges

Our main problems during development were to do with OpenGL's implementations themselves:

  1. The lack of debugging tools — GL Shading is not a trivial task. Especially, considering that there weren't any breakpoint debuggers or even a language server (LSP) supporting the shader language files.
  2. Hardware incompatibility — unfortunately only three out of our four members could actually compile the shaders on their own hardware. Additionally, hardware vendors have their own slightly differing specifications of the shader languages, leading to some changes compiling on some machines, but leading to compiler errors on others.

The Future

  • Add support for “food maps” (drawn from images) which model the behaviour of the slime where sources of food of near (similar to the oat flakes used in the Tokyo model).

Built With

Share this project:

Updates