I’ve recently released gpu-io – a #webgl computing library for real-time physics simulations, particle/agent-based systems, cellular automata, image processing, and general purpose GPU computations.

Examples: https://apps.amandaghassaei.com/gpu-io/examples/
GitHub: https://github.com/amandaghassaei/gpu-io

gpu-io makes it easy to build GPU-accelerated apps without worrying about low-level WebGL details and browser inconsistencies. Designed for WebGL2 with fallbacks for WebGL1. WebGPU support is planned! More in thread 🧵...

gpu-io has built-in helper functions for composing real-time physics simulations – e.g. for applying boundary conditions, flip-flopping prev/next state buffers, rendering particles, and adding touch interactivity. I’ve been using this library for all of my #shader experiments for the past ~3yrs, including the fluid/marbling work I’ve been up to lately.

gpu-io also plays nicely with #threejs – data can be passed between the two libraries without ever leaving the GPU:
https://apps.amandaghassaei.com/gpu-io/examples/wave2d/

Wave 2D

Had fun putting together the example docs for this repo. Here’s a zoomable Julia set fractal demo:
https://apps.amandaghassaei.com/gpu-io/examples/fractal/

You can zoom until you run out of floating point precision to calculate the image. Would be cool to make this infinitely zoom by taking advantage of self-similarity, I think the math is a bit tricky though...

Julia Set

Some examples simulating a slime mold (Physarum polycephalum) transport network:
https://apps.amandaghassaei.com/gpu-io/examples/physarum/

This one is a mix of grid and particle methods – lots of little agents interacting with an underlying field of chemo-attractants. Somewhat similar to how ants use pheromones to make trails. By adjusting the parameters of the simulation, different dynamics/patterns emerge.

Inspired by the incredible work of Sage Jenson:
https://cargocollective.com/sagejenson/physarum

Physarum

Reaction-diffusion system where two virtual chemicals interact to create dynamic patterns. Similar systems were proposed by Alan Turing in 1952 as a mechanism for pattern formation in plants and animals.

This system's behavior depends on two parameters that vary across x and y. Zoom around parameter space to find regions of interest:
https://apps.amandaghassaei.com/gpu-io/examples/reaction-diffusion/

Most of the dynamic behavior occurs in a small sliver of parameter space, but it's fun to explore!

Reaction Diffusion

@amandaghassaei I was browsing the code this morning. Really nice abstractions for shader passes between FBOs. The examples become very readable with all of the boilerplate you've tucked away! Super impressive, and thanks for sharing 🙌
@amandaghassaei fantastic, reminds me of the fractal drawing app I had on a floppy 💾 for my 4MB Atari STe.. much slower than this one is!

@MoogsBrain @amandaghassaei

The examples of the library on the website are really interesting! The fact they work so well on a smartphone is just amazing 😃

@amandaghassaei threejs interop is the killer feature for me! will definitely be checking this out.
@amandaghassaei Wow, this is very cool, and so are the examples!
@amandaghassaei totally awesome! Thanks for releasing it! How does it play with p5js?
@vicdoval I haven't tried that yet, probably should! I have to admit, I've been a bit out of the loop wrt p5 + shader stuff because I've been off doing my own thing. Let me know if you end up giving it a try!
@vicdoval fyi we're working through how to get this running with p5js in this thread: https://twitter.com/vamoss/status/1598332879884505091
@amandaghassaei I’m humbled. I understand maybe 10% of this post. (Toot?)
@amandaghassaei I would love a phone app that allows me to make marbled paper like the one in the background.
@Mark me too! planning to make that happen, but it's a bit on the back burner right now. more info on that here: https://blog.amandaghassaei.com/2022/10/25/digital-marbling/
Digital Marbling

I’ve been working on a physics-based marbling simulation to explore the ways that the traditional craft of paper marbling can be augmented digitally. Paper marbling is a centuries-old craft that uses the movement of water to create swirling patterns of inks and paints on paper (and sometimes fabric). The earliest accounts of marbling date back to the 12th century in Japan, where it is known as “suminagashi.” Inks were floated on top of water and manipulated into delicate, flowing shapes using breath, fans, and other utensils. Later, paper marbling traditions emerged in the Middle East and Europe, making use of more viscous media and fine-toothed combs to create repeating patterns with greater regularity and control.

Amanda Ghassaei
@amandaghassaei I love this. Would definitely pay to play with this on my phone. I have a friend who is curating a show on marbling in NYC who I’m sending this to. These videos on your blog are really good.

@amandaghassaei @Mark

Compliments, you created an amzing simulator.

Had a look at your blog and you mentioned somewhere building an orrery simulation.

Antikhytera mechanism. It is a kind of orrery from about 200 BC. An amazing example of greek astronomical, mathematical knowledge as well as engineering prowess.

https://youtu.be/xWVA6TeUKYU [1h49m]
Stanford lecture concerning the 100 year history of discoveries concerning the Mechanism

https://www.britannica.com/topic/Antikythera-mechanism
http://www.antikythera-mechanism.gr/

The Antikythera Mechanism: A Shocking Discovery from Ancient Greece.

YouTube

@antipode77 @Mark thanks for sending that! yes I've been following along with clickspring's Antikhytera reconstruction on youtube as well:
https://www.youtube.com/watch?v=ML4tw_UzqZE&list=PLZioPDnFPNsHnyxfygxA0to4RXv4_jDU2

pretty cool!

The Antikythera Mechanism Episode 1 - Greeks, Clocks and Rockets - #DialOfDestiny

YouTube
@amandaghassaei is this graphics-only acceleration on a gpu? Or can it be more general computations?
@MoogsBrain yeah it can do more general computations as well, it uses webgl as a way to access the gpu.