the Twarchive

This is a record of a twitter thread, originally posted in 2020

Thew
@AmazingThew

--s̸e̴l̷f̶i̷e̷s̵--

#generative

Thew
@AmazingThew

Thew
@AmazingThew

Thew
@AmazingThew

Did a bunch more of these last night but figured I should post while folks are awake lol

particles seek to flow along contours derived from images, while constrained by other rules

Thew
@AmazingThew

The state evolves slowly; all the previous images involved playing with the parameters or changing the contours over time

here's fixed parameters, but with basic mouse interaction to push stuff around

Thew
@AmazingThew

Using the previous rasterized image as an influence on the gradients, meaning particles can be affected by their neighborhoods

Currently mostly getting stuck in these whorl patterns, which are pretty but not super versatile:

Thew
@AmazingThew

An issue with having particles that move around based on feedback from their local neighborhood of nearby particles: This places me in *extreme* danger of becoming A Continuous Automata Guy

you can lose, like, entire lifetimes down the automata hole

I'll be careful okay

Thew
@AmazingThew

influencing velocity from neighborhood is promising, but hard to prevent it just feeding back ever-increasing forces

Thew
@AmazingThew

really hard to control the parameters but I like this one a lot

Thew
@AmazingThew

Blending the image-based gradient influences back in

Thew
@AmazingThew

swoosh

Thew
@AmazingThew

s̵̫̈́e̸̠̅l̶͍͝f̴̛͎ȉ̷̳e̷͍̾

Thew
@AmazingThew

Just watching this go is really fun

This is mainly just velocity feedback. Particles write their velocity to a buffer, blur it, and then sample the blurred velocity when updating their new positions. Decay/smoothing/curvature are tuning vars but the feedback does most of it

Thew
@AmazingThew

bwoop boop

Thew
@AmazingThew

invaders

Thew
@AmazingThew

twitter REALLY did a number on the video compression lol

here's a link to the actual file in case anyone feels like seeing what it actually looks like...

attached image

Dropbox
ParticleInvaders.mp4

Thew
@AmazingThew

thought process:

"these look surprisingly fluid-like for such simple rule sets"

"eh, there are a lot of automata-based approaches to fluid sim; it's not unrelated"

"molecules in a real fluid are arguably a form of automata anyway right"

STEPHEN WOLFRAM WANTS TO KNOW YOUR LOCA

Thew
@AmazingThew

Initializing the positions with uninitialized memory was apparently a good idea

Thew
@AmazingThew

Galaxy Launcher

Thew
@AmazingThew

ceaselessly upping selfie game

Thew
@AmazingThew

so this is actually what I originally meant to try

particles are attracted by image gradients, meaning they'll flow towards lighter areas, but they also repel each other

result is a dithering pattern vaguely reminiscent of error-diffusion approaches, but parallel and weird/cool

Thew
@AmazingThew

Repulsion and other neighborhood effects are accomplished via a trick: rasterizing everything to a buffer and then blurring the buffer. With additive blending a cluster of particles will produce a steeper gradient, and therefore a stronger repulsive force

Thew
@AmazingThew

The cool bit is this allows particles to influence their neighbors without needing to actually perform any sort of neighborhood query or build acceleration structures

it has a TON of limitations but for just messing around doing art stuff it's extremely powerful

Thew
@AmazingThew

(this is essentially a form of the "particle in cell" technique used for certain types of fluid/physics sims, but like, not at all principled)

Thew
@AmazingThew

Really like the way it sort of picks out long/thin details like hair and the glasses frames

worth noting the particles are barely 1px across and VERY low alpha; every dot you see is actually a clump of dozens of them pushed together by gradient forces

Thew
@AmazingThew

All of the weird CA-like rules for inter-particle interactions that I used for the earlier images are still here, and they can still work together with the forces that produce the stipple effect

works surprisingly well with webcam input

Thew
@AmazingThew

Compression smudges the details obviously, but keep in mind that nothing's directly reading the image or setting a pixel brightness here. It's two million separate particles with constant brightness changing their positions