top | item 41604131

(no title)

pcouy | 1 year ago

Hey! I'm the author of this article and just noticed the huge traffic spike.

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

discuss

order

danwills|1 year ago

Great work on the article and video!

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!

danwills|1 year ago

Ah damn was meant to be asterisks there (ie multiplication of ucolor by U etc) but it got turned into italics!

ryanartecona|1 year ago

This reminds me of this other work[1], which is also a fascinating example of emergence from a dynamical system. Instead of a chemical reaction model, it's a model of slime mold growth, as a system of particles and some update rules. They haven't posted new work in a while, but you can still see many video renderings on their twitter[2] using variants of it that are absolutely mesmerizing.

[1] "Physarum" by Sage Jenson https://cargocollective.com/sagejenson/physarum

[2] https://x.com/mxsage

pcouy|1 year ago

Emergence is mesmerizing in the literal sense. For me, I think the fascination takes its roots in how all biology - from the apparition of life to how brain works - happens thanks to emerging behaviors.

Anyway, thanks for the share, it makes me want to try implementing it as well.

davedx|1 year ago

I considered trying to do something like this for CFD (specifically to see if I could show how lift is created by airflow over an airfoil). I got kind of stuck on it though and gave up, too far out of my area. Awesome to see others doing things like this though, feels like it’s an area ripe for exploitation!

pcouy|1 year ago

I tried making fluid dynamics in a similar way right after making this, but I gave up as well. As far as I remember, I got stuck on managing non-miscible fluids (such as air and water) which introduces some edge cases where they meet.

DylanSp|1 year ago

This is really cool, it looks like it's pretty easy to get started with Shadertoy and your guidance.

One nitpick: in section 2.1.1 on implementing the reactions, you refer to "simulating the reaction A + 2B -> C"; should this have "4C"?

pcouy|1 year ago

The section you're referring to is meant to first give the update rule for the general-case of a reaction that is not autocatalytic.

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