Real time reaction diffusion using opengl
You can learn more about reaction diffusion there: http://karlsims.com/rd.html The simulation is run at 60Hz on a 800x600 periodic grid with several initial conditions. The simulation is stepped 50 times between each frame, allowing a life-like behavior in real time. The CPU alone wouldn't be able to achieve such speed, hence the GPU is used to update the grid with opengl. The grid is represented by two framebuffers which are swapped alternatively. The first framebuffer represents the previous state and is used as a texture by the second one to compute the next step using a fragment shader. This process is carried out off-screen and once a set number of iteration is reached, another shader renders everything on screen. One minute of simulation corresponds to 60*60*50 = 180,000 steps. Only two chanels of the framebuffers are used to represent the concentration of the chemical species A and B. Therefore this technique could be extended to a reaction involving up to four species whitout any modification.
Download
0 formatsNo download links available.