This is a 2D cellular automaton with an update rule that makes it cycle. It’s seeded with random noise. Try turning the number of states up to 20 or more, making it really big and ticking the “Go fast?” box.
This is written using WebGL with the CCA update step calculated in a fragment shader. There are a pair of textures (at least as large as the canvas) that are alternated between, reading from one and writing to the other each frame, then swapping them.
The concept of a CCA is documented on Wikipedia. As far as I can remember, I was first introduced to the idea by someone on nightstar.net about ten-ish years ago. :)
This should work on most desktop GPUs. I wrote it on an Intel HD4600 GPU and got at least one person to try it with a GeForce and a Radeon card. It seems to work okay on my Android phone, too. :)
It’s working for me in Firefox and Chrome. It probably won’t work in MS Edge yet because they still haven’t marked their webgl implementation as being production-ready, as far as I know. I’d be slightly interested to hear if it works in other browsers like Safari and friends.
Currently open questions:
vec4s which are vectors of 4 floating point numbers in, I think, the range [0, 1).GL_TEXTURE_RECTANGLE in WebGL, which would’ve made indexing easier instead of having to calculate dsdt and stuff.Currently known imperfections:
states + 1.0 instead of by states in the quantize() function. I’m almost certain I’ve got that maths wrong.