Learning Processing: GPU Implementation of Grey Scott model for the reaction-diffusion algorithm as presented here: karlsims.com/rd.html. After having seen the very clear tutorial by Daniel Shiffman about this model (here: youtube.com/watch?v=BV9ny785UNc), I decided to take it a step further, implementing it as a shader.
Thanks to the GPU power this version can run very smoothly with many iterations on a 1920x1080 screen.
This is my first attempt to code a Shader. I used a texture as a source for the shader, where the red channel represents chemical A and the green channel represents chemical B. Then the resulting image becomes the source for the next frame. I created a second shader to handle the rendering, in order to map the resulting values to a greyscale image - in this case - or potentially to any kind of colors/gradients combinations.
For the GLSL shader code, I took inspiration from the blur shader present in the Processing examples folder.
This algorithm is very useful to generate many kinds of natural patterns. Changing the parameters, even by tiny amounts can bring to interesting complex results. This video is just me playing with the parameters for some minutes.
music: Natus - Cure (natusineternalsleep.bandcamp.com/releases)