I’m working on a fractal flame system (aka the Electric Sheep algorithm). The algorithm is described here: https://flam3.com/flame_draves.pdf, on Wikipedia, and chapter 3 in Evolutionary Visual Art and Design.
This repo can give some intuition for it too FractalFlame/FractalFlame.pde at master · CodingTrain/FractalFlame · GitHub
It’s a very sequential algorithm. You pick a random point and then apply transformations to that point millions or even billions of times. I think that the Processing demo does the algorithm correctly.
However, I can imagine making some sacrifices to the algorithm to parallelize it a bit. For example in a compute shader you could have different threads all doing their own particle iteration. The issue then is that the threads are writing to the same buffer, and there could be race conditions if they write to the same location. What’s the way to make sure one thread finishes before another even begins? I couldn’t accomplish it with memoryBarrierShared and barrier().
Suppose you had only one thread, I think you can’t do more than 4096 iterations because the GLSL compiler prevents this.
So I’m wondering what are some ideas for doing fractal flames with GLSL?
I found this repo too FractalFlames/FreeParticle.cs at master · nshelton/FractalFlames · GitHub
But I’m not sure how strictly it follows the original algorithm either. It seems to have 1000 particles and each particle is only iterated once per frame?