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 😃