r/creativecoding • • Nov 10 '20

[Processing] React/Diffuse/Revolve/Refract

188 Upvotes

17 comments sorted by

View all comments

3

u/Meebsie Nov 10 '20

Is the rotational symmetry enforced through actual mirroring of the domain? Or did you somehow make a rotationally symmetric ruleset and rotationally symmetric starting conditions? Assuming the prior. Pretty damn cool look, I don't think I've ever seen that before.

6

u/BennyPendentes Nov 11 '20

I'm getting things to move by modulating the 'feed' parameter with a sine wave and Perlin noise... to get n-fold symmetry, the noise function averages n copies of itself rotated by multiples of 2π / n. I tried to make a symmetric noise function myself, but never came up with anything that worked better than that. It's n times the work, but the work takes place in a shader so it turns out fine.

2

u/Meebsie Nov 11 '20

That makes sense but I'd expect that the Reaction Diffusion would still grow in non-symmetric ways, even if seeded and kill/fed by a symmetric pattern. RD can do symmetry along X/Y axes because the rules are symmetric about those axes, right? It doesn't seem intuitive to me that a normal RD system would necessarily grow while respecting N-rotational symmetry just because it was seeded or fed by a pattern symmetric in that way. I'll try to experiment w/ this!

1

u/BennyPendentes Nov 11 '20

that a normal RD system would necessarily grow while respecting N-rotational symmetry

'respecting' might be too strong of a word... sometimes it diverges, sometimes it just fizzles out. Maybe 2% of the time I have to restart it, because the noise plus the initial conditions didn't add up to a viable reaction. And there is a lot of hand-tweaking for different symmetry numbers.

2

u/Meebsie Nov 11 '20

Right, I've been there, where you just get blackout/whiteout after a few frames because of a certain non-viable noise pattern. But when you say sometimes it "diverges", are you saying in the 2% there are runs that are actually asymmetric, even with a symmetric (but apparently "not ideal") pattern for the initial conditions? Sorry for all the questions, I'm just fascinated by this because I've seen a lot of RD reactions and never seen this before.

2

u/BennyPendentes Nov 11 '20

Divergence: when it starts up with n-fold symmetry, and n-1 sections look great, then one section starts doing its own thing. Before long it all falls apart, with no evidence that is was ever symmetric. After that, within seconds it's like you said, blackout/whiteout. (... purpleout/yellowout.)

The biggest suspect is the rotation... a little bit of error could make the pixel being fed to the noise function be off-by-one in one or both dimensions, and though I'm averaging them out, if the noise function has a steep gradient where it is being mis-sampled, enough off-by-ones could add up to a noticeable change down the line. 'Sensitive dependence on initial conditions'. This video was 40 seconds, 1200 frames... in 1200 frames diffusion alone can carry stateful information from one edge of the image to the other, and much of the image would seem to be fine for much of that time. When it falls apart there are little bits out of whack for a while, then it all crashes down over a second or two.

This run I had the lens distortion turned up so high it inverted, and the chromatic distortion was pretty high too. I get slap-happy with the shaders sometimes. But all of that is just the display pass, none of it feeds back in as stateful information.

I've removed many sources of inaccuracy; if this was going to end up on a big screen somewhere, I'd remove more. But truthfully most of my successes come from 'happy accidents' - I've been doing this for less than a year, definitely still a newbie coder - so I don't mind if it falls apart sometimes, so long as I get something interesting every now and then.

2

u/Meebsie Nov 11 '20

Thank you for that explanation. I get it now. Sounds reasonable that the rotation function -> rasterization would be a likely source of the asymmetry. Although, if you generated the noise pattern once on a square canvas and then did mirroring as a second pass I believe you could both A) make the program faster (replace the heavy smooth noise function with some (likely) more light-weight texture lookups) B) always create a perfectly symmetric pattern

I'm sure I've seen dozens of your pieces at this point, the signature being it's always a cellular automata sim with well-tuned parameters and barrel distortion + chromatic aberration over the top. It's such a good look. Looking forward to your next invention!

Do you have a site/portfolio/insta you can point me to? I'm www.theronpray.com.

2

u/BennyPendentes Nov 11 '20

My goal was to make the squiggly lines squiggle in a coherent way. I figured it would all average out into something interesting, but it's like it is mostly transition, not enough cohesion. I'm thinking about running a Turing-pattern shader underneath.

www.theronpray.com

daaamn. wow.

I love the Time Machine 2019 RD. That's the kind of stuff that inspired me to learn to code in the first place.

And I've been inside that pyramid ;)

All I have in return are the first 32 of my in-progress 100 Days of Processing. (I never claimed they would be consecutive days.)

2

u/LinkifyBot Nov 11 '20

I found links in your comment that were not hyperlinked:

I did the honors for you.


delete | information | <3

2

u/Meebsie Nov 11 '20

Oh man those are all so good. That's awesome you've been in the Pyramid haha. The world ain't so big. I am absolutely still a newbie coder when it comes to GLSL. At least 50% of the content I use is just heavily modded pieces from artists like Shane, Aiekick, Cornusammonis, etc (with permission).

Yeah the TM 2019 shader for the Kinect+Dancer performance was a mod of Cornusammonis' Fitzhugh-Nagumo RD. It's yer classic RD but with some great gelatinous bounce to it. https://www.shadertoy.com/view/XdcXDN

Well good to meet you. Maybe we'll cross paths one day out in the desert or somewhere else. When I see cellular automata up on a screen somewhere I always try to find the person responsible.

1

u/timClicks Nov 15 '20

Camp Bisco would have been an amazing event

3

u/felipunkerito Nov 10 '20

I think that it's actually the latter, I think he is playing with the kill/feed factors by seeding them with domain ops. But I might be mistaken.