Arvutiteaduse instituut
  1. Kursused
  2. 2024/25 sügis
  3. Arvutigraafika (MTAT.03.015)
EN
Logi sisse

Arvutigraafika 2024/25 sügis

  • Main
  • Lectures
  • Practices
  • Projects
  • Exam
  • Results
  • Links

    Slimulation

    Joosep Suuder, Henri Maandi, Kerli Tasso

    This project simulates the behaviour of Physarum Polycephalum, the true slime mold using compute shaders and Godot 4.0. Based on this paper by Jeff Jones.

    Physarum Polycephalum


    The algorithm

    The algorithm works by generating x amount of particles specified in the UI and keeping track of each individual particle location on the screen and the rotation of any given particle. During runtime the location of each particle is recalculated using the compute shader. Each particle has "sensors" at the right, front and left side, the algorithm looks at the RGB values at each of these locations assigning negative values to channels that are not in this particle's species and a positive value to that which is. (The first species uses the red channel, the second the green channel etc.). It then selects the direction which has the highest weight and then adjusts the rotation of the particle in accordance. Finally a new location for the particle is calculated using the speed parameter and the rotation. In addition a fragment shader dims each pixel on the screen each frame to give each particle a trail which other slimes can follow.

    A crude representation of the algorithm decision making

    Here you can see different particles and their trails


    The UI and parameters

    Before starting the program, the user can tweak different parameters for the rendered slime which alter the behaviour of the individual particles.

    ParameterWhat it does
    Number of slime particlesAdjusts the number individual particles on the screen
    Number of slime speciesAdjusts the number of different slime species/groups on the screen
    Speed of particlesAdjusts the number of pixels each particle jumps after determining the direction of travel
    Turning speed of particlesAdjusts the amount the particle turns after determining the direction of travel
    Sensor distanceAdjusts the distance at which the sensors sit at the right, front and left side
    Sensor angleAdjusts the angle at which the sensors sit at
    Starting menu

    2020 Michael Fogleman

    Generated to mimic the picture above


    Simple three group rgb slime

    The slime mutating by adjusting the parameters during runtime

    A run of the simulation with 5000000 particles can be seen here.


    Try it for yourself!

    To try the project out for yourself download the .exe file here.

    Our repository is available here. Refer to the README file for instructions on how to run the algorithm and see the code.

    • Arvutiteaduse instituut
    • Loodus- ja täppisteaduste valdkond
    • Tartu Ülikool
    Tehniliste probleemide või küsimuste korral kirjuta:

    Kursuse sisu ja korralduslike küsimustega pöörduge kursuse korraldajate poole.
    Õppematerjalide varalised autoriõigused kuuluvad Tartu Ülikoolile. Õppematerjalide kasutamine on lubatud autoriõiguse seaduses ettenähtud teose vaba kasutamise eesmärkidel ja tingimustel. Õppematerjalide kasutamisel on kasutaja kohustatud viitama õppematerjalide autorile.
    Õppematerjalide kasutamine muudel eesmärkidel on lubatud ainult Tartu Ülikooli eelneval kirjalikul nõusolekul.
    Courses’i keskkonna kasutustingimused