Flux is a particle simulation playground that I made to learn about compute shaders within DirectX 12.

Flux comes with a small editor and currently provides three different particle simulations:

  • N-Body
  • Physarum Polycephalum
  • Particle Life

Nova’s framework has been fully written in C++. The entire project is open-source and available on GitHub: https://github.com/stefanpgd/Flux

The project duration was two weeks and I started April 2024.


N-Body

One of the more traditional particle simulations. Flux presents the simulation running between 50 thousands to 4 million particles running Newton’s Gravitational Equation.

It uses procedural color palettes to give emphasis on particle density.

I also provide a similar, more interactable version where the only point of attraction is the mouse.


Physarum Polycephalum

Based on a paper by Jeff Jones, I recreated a digital version of the real life slime mold called Physarum Polycephalum. Here the simulations runs with over two million agents.

The agents lay down a path that dissolves and diffuses over time. This path gets used by other agents to identity optimal pathing. Creating lifelike organic patterns.

Like the other simulations, settings are available that involve Agent speeds, visibility, turn speed etc.


Particle Life

The last particle simulation I made is Particle life. It’s purpose is to mimic how real life cells/particles react to each other.

Here different types of particles have assigned a color. Each color has a corresponding matrix of whatever it likes or dislikes. Particles get attracted by particles they like, while avoiding the ones they dislike.

The gif on the right showcases how a slight difference in a particle’s attraction factor can adjust the entire simulation.

This relatively straightforward simulation represents the phenomena of ‘Emergence’ the best, showcasing complex behaviour that occurs out of a simple rule set.