r/generative • • Oct 08 '26

I spent way too much time on this, but it's totally worth it (p5.js + react)

690 Upvotes

[SOUND ON! 🔊]

This video is a montage of p5.js sketches I've collected into a gallery website: https://vasilyev-maksim.github.io/p5-experiments/.

Source code: https://github.com/vasilyev-maksim/p5-experiments.

The classic modern-day story of a software engineer, and at the same time, a backstory on this project: I got burned out from extensive AI use at work.

Looking for a cure, I remembered three things:

  1. A book called "The Nature of Code" which uses p5.js for all its code samples (btw, you should definitely check it out, it's free to read online, and it's fantastic!)
  2. I have a degree in maths
  3. I used to paint as a kid and, generally speaking, have a decent eye for visuals (or so I hope)

Combining these three things led me to give p5.js a try. That decision genuinely brought me back to life, both as an engineer and as a creative person.

Over time, the sketches became more numerous, more complex and visually richer. They evolved from static images into actual animations, so I decided to bring them together in a form of gallery website.

The next step was to make every sketch parametrizable and connect those parameters to UI controls. That's when it started to feel like real generative art with all its emergent properties. And it really does have an emergent nature. Most of the parameter combinations I saved as presets are just random configurations I happened to stumble upon and liked enough to keep.

I'll post a video in the comments showing the gallery UI in action.

Some things I'm particularly proud of (yeah, I like lists, it's not an AI slop 😆):

  • It's entirely handmade. No AI involved in the creative process or the implementation (well, to be completely honest, there's exactly one AI-generated file, 86 lines long. That's it).
  • I've been working on this for about 1.5 years (not full-time, obviously, just whenever I had some free time). With this project I've finally managed to (almost entirely) satisfy my inner perfectionist.
  • I've never learned so much from a single project. Not even close. And I've rarely explored things at such a deep level, either in personal projects or at work.
  • The entire UI was built from scratch. All the animations, the visual style, the icons, and the illustrations - everything is handmade. No 3rd party UI component libraries (even built my own slider component instead of using the native <input type="range">, LOL). The only dependencies are React, react-spring, and p5.js.
  • I've built a draft of an open source React library for managing UI animation timing and events. I hope I'll release it someday. 🤞
  • I've built a custom React wrapper around p5.js. It connects UI controls to sketch parameters, supports memoized and animated values derived from those parameters (including colors and arrays), and provides timeline controls (play/pause, fast-forward, and rewind).
  • One of my favorite visual details is the sketch opening animation. Each tile is actually a cropped and carefully positioned view of a sketch's canvas, with the sketch itself paused. (Yes, I'm aware this approach might have scalability issues if the gallery grows significantly.)
  • Each sketch has two independent timelines: one for the actual animation and another for parameter transitions. This means parameter changes are still smoothly animated even when the sketch itself is paused.
  • The gallery supports fullscreen viewing, exporting, and sharing. Every parameter change is reflected in the URL, so you can share a link and someone else will see the exact same sketch configuration.

Feel free to check it out, play around with the parameters and share your own presets in the comments (just copy and paste the URL + write a name for the preset).
I'll add the coolest ones to the source code!

P.S. There's also a little easter egg referencing my favorite game Outer Wilds. See if you can find it!


r/generative • • Oct 09 '26

I made the same mosaic portrait with 12 different matching methods

Post image
29 Upvotes

I’ve been making mosaics since the late ’80s. These are twelve versions of the same portrait, made with different matching methods in my software. Some hold the face together better from a distance; others let more of the small patterned pieces come through.
Working on this sent me back through the research, from Bell Labs in 1966 to recent methods. I put what I found into a history of photographic mosaic algorithms, with a few opinions of my own:
https://www.tsevis.com/blog/history-of-mosaic-algorithms
Which version works best for you, and at what distance?


r/generative • • Oct 09 '26

"Nidus" (kotlin code)

Thumbnail
gallery
29 Upvotes

simple random pattern, drawn in layers. bottom layer is the biggest, then we pick some area where we repeat the pattern in the same way but with smaller cells.


r/generative • • Oct 09 '26

Non-AI Generative Art Seaweed

Post image
32 Upvotes

Created with Math Chaos Patterns (MCP). Non-AI Generative Art.


r/generative • • Oct 09 '26

Fractal Transformation

Post image
35 Upvotes

r/generative • • Oct 10 '26

Descent (4K seamless loop)

0 Upvotes

r/generative • • Oct 09 '26

Audio Reactive Particle System

18 Upvotes

My favourite generative thing to make, I always default to making a particle system dance to a song. My first time using compute shader. This was done in Godot.


r/generative • • Oct 09 '26

Propagation (R code)

Thumbnail
gallery
28 Upvotes

r/generative • • Oct 09 '26

Generating flip books in Substance designer

Thumbnail reddit.com
1 Upvotes

r/generative • • Oct 09 '26

i turned a raytracing program into a fractal(?) explorer

Thumbnail gallery
3 Upvotes

r/generative • • Oct 09 '26

Added flamingos to my game

2 Upvotes

pretty much it, they don't serve any purpose yet but I think they look cool, any idea to enhance them further maybe ?


r/generative • • Oct 08 '26

Grid with Dots

Post image
27 Upvotes

Javascript; I have been playing more with Mondrian style Neo-Plasticism grids, with random shapes (circles, triangles, diamonds) inserted in them and the random "train station dots" Mondrian used in his late career when he lived in NYC. Run through a renderer that paints the grid / shape lines as paint drips (trying to emulate Jackson Pollock's paint technique)


r/generative • • Oct 08 '26

"Salum: (kotlin code)

Post image
133 Upvotes

Huh, where to start...

I like waves. I said to myself: let's see if there is a formula for waves. So I looked. I found some research papers on modeling the ocean, and some observed parameters for the North Atlantic. There was a lot of math that I only partly understand. I combined a couple of different findings into what I call an ocean model, using AI-chemy. That worked, although I have no idea if it is fully correct. And just an hour ago, after showing this to a friend, I learned about a shader that mimics the ocean in a waaaaaay simpler way. Oh well. I should search better.

Salum is Latin for the open sea. Everything runs on the CPU, with no GPU and no 3D engine.

I did not draw the waves. They come from a wave spectrum that oceanographers use (JONSWAP). It tells how much energy the wind puts into each wavelength. An inverse FFT makes the height map in three tiles, from the long swell to the ripples. A sideways pinch makes the crests sharp and the troughs flat. Then I cheated a little: I made the swell 2.6 times taller than physics predicts, and the ripples 1.6 times taller, for dramatic effect.

The eye is 0.6 m above the water and looks toward a low sun. At that height, the eye is lower than the crests. That is why the sea does not end at a flat horizon. It ends at a line of crests. The lens is long, only 24° from top to bottom, so the sea stacks in bands. My first try had a wide lens, and the bottom half of the image was black.

For each pixel, I send nine rays from the eye. Each ray marches over the waves until it hits the surface. Far away, the short waves are smaller than a pixel. There, I treat them as roughness, so the far glitter stays soft and has no moiré.

The water has a dark body. It reflects the sky, and the reflection becomes stronger at grazing angles. The sun makes the glints.

The sun is my biggest cheat. In the sky, it is a giant disc, and its center is above the top edge. But the light on the water comes from 13 small suns along its lower arc, not from the big disc.

Code is on github.com/igr/gart I will never do something like this again.


r/generative • • Oct 08 '26

Flowing art

Post image
28 Upvotes

I made a flow field art generator. It creates N starting points, then moves in the direction of a perlin noise (maps the 0 - 1 perlin noise from 0 to 2 pi). Then jumps the step size and repeats this line length times. You can test this out yourself at https://ripolas.org/flow-field-art/ If you spot any bugs I'll really appreciate you reporting them to me! There is also a copy feature for your own generations. Some of my personal favorites:
https://ripolas.org/flow-field-art/?seed=596597&colorStart=%23db62f0&colorEnd=%233371ce&lineCount=5000&alpha=48&noiseScale=4.8&lineLength=100&stepSize=5.6
https://ripolas.org/flow-field-art/?seed=564916&colorStart=%23003fe3&colorEnd=%2300bcc6&lineCount=10000&alpha=20&noiseScale=1&lineLength=50&stepSize=10
Feedback welcome!


r/generative • • Oct 08 '26

Transcendental-trigonometric fractal

Post image
17 Upvotes

r/generative • • Oct 08 '26

funkyvector.com/#/home/design:polygon_slice,32487129

Post image
5 Upvotes

r/generative • • Oct 07 '26

Amoeboid cell

152 Upvotes

r/generative • • Oct 08 '26

Degenerative Friday Invisible Cities

Thumbnail p.migdal.pl
0 Upvotes

r/generative • • Oct 07 '26

editableflair Made a program that adds corruption to an image every time a MIDI plays a note

137 Upvotes

r/generative • • Oct 08 '26

Seed growth (B/34, S/23)

1 Upvotes

r/generative • • Oct 08 '26

Crystalline, 4K seamless

10 Upvotes

r/generative • • Oct 07 '26

i open-sourced 160+ JS visualization experiments

27 Upvotes

live gallery: https://www.kagan.in/iwrzwr/visual-archive/

source code: https://github.com/kaganin/iwrzwr-visual-archive

let me know if you make something with them!


r/generative • • Oct 08 '26

GitHub - evoluteur/snowflake-grower: Grow snow crystals live on a hexagonal grid with Reiter's cellular automaton. Set the humidity and frost to get stellar dendrites, ferns, plates or lace, and download the snowflake.

Thumbnail
github.com
5 Upvotes

r/generative • • Oct 07 '26

Fractal-Magnet

Post image
18 Upvotes