Physarum Simulation

A simulation of the Physarum slime mold accelerated by using two separate OpenGL compute shaders

NO_IMAGE

Screenshot of a simulation run with 2,000,000 individuals running at ~120 frames per second

Overview

This project is comprised of a simple simulation program simulating the Physarum slime mold. The software is written in C and utilizes OpenGL compute shaders to do most of the simulation. Two separate compute shaders are employed by the software. The first one performs agment (individuals) movements and the second one applies a blur operation on the generated image to spread pheromones.

My RX 6700S powered machine is able to simulate 2 million individuals at around 120 frames per second. Overall, I am quite happy with the achieved performance, as the shader code is not fully optimized.

The simulation is inspired by and based on this video by Sebastian Lague.

Sources

Complete source code is publically available here at my GitHub. The project can be easily compiled using CMake and make. Note that the software requires the GNU Getopt library for argument parsing, SLD2 for window management and OpenGL for graphics and computation.

Last update on March 8, 2024

Luca Anthony Schwarz

lucaanthonyschwarz@googlemail.com