Mitosis in the Gray-Scott model: writing shader-based chemical simulations
pierre-couy.dev
pierre-couy.dev
This was my first time writing a shader. I was just playing around on shadertoy when I realized I could implement this chemical model that has fascinated me for quite some time. I'm really happy with how well my results align with results from other people who have done this before me.
While writing the article, I noticed that the same kind of shader implementation has already been done before.
Feel free to ask me anything about the implementation or the chemical model
One nitpick: in section 2.1.1 on implementing the reactions, you refer to "simulating the reaction A + 2B -> C"; should this have "4C"?
I'm not sure what made you think it should have 4C, but if you want to explain me the reasoning that led you to this conclusion, I'd be glad to fix the article and make it clearer
EDIT: Also, the text after the equations says "Notice that the numbers in front of speed(t) come from the quantities in the equation that summarizes the reaction."
[1] "Physarum" by Sage Jenson https://cargocollective.com/sagejenson/physarum
Anyway, thanks for the share, it makes me want to try implementing it as well.
I've played with RD's especially Gray Scott a lot in Gollygang/Ready, and found some fascinating behaviours that I then brought into Houdini for visualisation, here's a couple of examples:
https://youtu.be/4dWJ504FULw?si=lWBrhaL2J12o58e1
https://youtu.be/Naj_J8aznyk?si=lb0WrkrUaCDg-Rzl
One thing that can help them to look nicer (in my opinion) is a reinterpretation of the reagent values as specific colours before display.. even something as simple as: pow(Uucolor,upow) + pow(Vvcolor,vpow) can be nice with well-picked ucolor&vcolor and powers. Other possibilities like hsv-to-rgb on the values can be pretty interesting too!
Unfortunately, my writeup isn't anywhere near as coherent on the technical/engine details, and the actual code is a right mess. It's more focused on the pattern family design.
Overall, my results came out very similar to Lenia in many ways, and some discovered patterns also directly resemble reaction diffusion.
---
https://slackermanz.com/understanding-multiple-neighborhood-...
I agree some of the MNCA examples are very reminiscent of things that various RD's do, the one titled "A more complex MNCA example" has a similar oscillating-worms feel to something I found in a modified Gray Scott:
I've been checking out some of the huge amount of output that you and Jason from Softology have made with MNCA, so awesome to see, top work!!
I also cloned the vulkan-mnca repo from your github and it compiled and ran without any issues on my thankfully very-recently completely-updated Gentoo. I'm over the moon about that!! I've been meaning to try to wrap my head around what vulkan is like to work with and this looks like a perfect example for the kinds of things I'd want to play with! Utterly choice to connect with you, thankyou HN for being so choice! (especialy dang!)
Edit : Ahah I just noticed the "other commenter" is you
It's a rather out-there (non-serious) idea where all the usual 'stuff' of a GUI is actually made out of dynamically-simulated-CA/RD cells interacting with each other.
Let's say for example once one had developed some way to reliably simulate a dynamic but smooth and stable enclosed area with a boundary (like a bag?), well you could call that layer a 'window'-ish-type-thing and constrain the sub-simulations (ie the window-widgets) to only grow inside the window. Window-docking could perhaps have behavior a bit like bubbles-adhering-to-each-other as a natural outcome of the simulated-nature of them and wobbly-windows could be made to be a natural outcome of there being the wave-equation as one of the formulae being used, and other things like that.
It's definitely an out-there idea not really intended for regular-consumption but I think it could be super fun to explore especially for playful in-game-UI use-cases.
I want to try my hand at writing such a general case continuous cellular automata engine, but I first need to dive into the literature around Lenia, and this is only one of the many things I want to try...
Anyway, thanks for sharing your work. I took a quick look at your write-up and will definitely come back to it later.
https://github.com/GollyGang/ready
Some fun ones from me can be found in Patterns/Experiments/DanWills