GLSL/Marching Cubes Reaction Diffusion
Class | Instructor | Date | Language | Ta'ed | Code |
---|---|---|---|---|---|
CS 7492 Simulation of Biological Systems | Greg Turk | Spring 2015 | GLSL/Java/Processing | No | Github Repo |
Here's another project that started as a fairly simple assignment that I chose to augment in numerous directions to learn more advanced techniques. In this case, the assignment was to implement Reaction-Diffusion in 2D using a couple of different integrators (Forward Euler, Backward Euler, ADI). I had already done this by the time I took this class, as a week-long project while I was pursuing my undergraduate Research Assistanceship with Greg Turk, who also taught this class, so I chose to augment the assignment a bit.
First, I coded the base 2D Reaction Diffusion algorithm on a shader, which proved trivially easy to implement, and easy to modify with a 3D stencil for 3D. Then I coded the Marching Cubes algorithm and implemented the shader-based algorithm for RD for a 3D space, using a concentration threshold to render a particular concentration contour surface in 3D.
Below are some videos of the 2D and 3D reaction diffusion system :
2D CPU ADI Method Spots |
2D CPU Pure Implicit Method Stripes |
2D Shader Parameter Map Control Parameters are varied along x and y axes, to display various patterns possible with different configurations. |
3D Shader/Multi-threaded Marching Cubes Stripes. All the 3D methods solved the reaction diffusion equation on a fragment shader. |
3D Shader/Multi-threaded Marching Cubes Stable.By tweaking the parameters as the simulation ran, I was able to get it to settle on a stable configuration. |
3D Shader/Multi-threaded Marching Cubes Oscillation.Again, by tweaking params, and modifying the MC contour threshold, the simulation settled into an oscilating state that was fairly resistant to modifications of the control parameters. |
3D Shader/Multi-threaded Marching Cubes Parameter Map.The two controlling parameters of the partial differential equations used to derive the RD results are varied positionally, along the x and y (vertical) axes. |