Gold, Sediments, Waves and Oil

Sometimes an idea for a generative art project starts with data, a mathematical rule or something I’ve deliberately gone looking for.

This one started with an ornament sitting on my desk.

It’s one of those liquid motion ornaments filled with coloured sediment, oil and air. Turn it over and gravity takes care of the rest. The different materials slowly separate, collide and flow past one another, creating landscapes that exist for a few seconds before disappearing.

I’ve always found them strangely fascinating.



A little bit of 90s nostalgia

I remember seeing these sorts of things in gift shops while we were on holiday when I was much younger, particularly during the 1990s.

They’d be alongside lava lamps, plasma balls and all the other slightly odd things that seemed impossibly interesting at the time.

My dad always took a particular fancy to these liquid ornaments. I can remember stopping to look at them and watching the sand and oil slowly make their way from one side to the other.

There was something compelling about the fact that you didn’t really control what happened. You simply turned it over and watched.

Years later, I’ve somehow ended up with one sitting next to my computer.

And while watching it recently, I started wondering:

Could I recreate some of that behaviour with code?



Looking closer

Taking a few close-up photographs made the ornament considerably more interesting.

From a distance, you see flowing purple sediment.

Up close, there’s much more going on.

Tiny particles collect into dense areas before thinning out into clouds. Oil forms bubbles of wildly different sizes. Those bubbles gather into groups and channels. Sediment flows around them. Fine gold particles occasionally collect along boundaries, while elsewhere large areas remain almost completely empty.

It started to look less like a desk ornament and more like an abstract painting.

That became the starting point for the Processing experiment.


Building the system

I didn’t particularly want to reproduce the ornament literally. The aim was to identify some of its behaviours and use them as rules for generating something new.

I started with a 1600 × 1600 pixel white canvas and a limited palette derived loosely from the ornament: blue, purple, magenta and a contrasting sediment-like gold.

Rather than drawing large solid shapes, the colour is made from thousands of tiny particles.

Each particle starts somewhere within a larger group and moves across the canvas according to a flow field.

A simplified version of the idea looks something like this:

float n = noise(
  x * flowScale,
  y * flowScale
);

float angle =
  n * TWO_PI * 2.9;

x += cos(angle) * speed;
y += sin(angle) * speed;

I’m using Perlin noise here because completely random movement quickly looks exactly that: random.

Noise gives neighbouring particles similar instructions. Instead of visual static, thousands of individual dots begin to form currents, folds, waves and larger structures.

That’s where the experiment became much more interesting.



Making bubbles into obstacles

Initially the bubbles were simply circles drawn over the finished artwork.

Visually it worked, but physically it didn’t make much sense.

Looking again at the real ornament, the bubbles are part of the system. Material has to move around them.

So the bubbles became obstacles within the simulation.

When a particle approaches a bubble, its normal direction is altered. An outward force stops it entering the circle while a tangential force encourages it to travel around the circumference.

Conceptually, it became something like:

float nx = dx / distance;
float ny = dy / distance;

float tx = -ny;
float ty = nx;

vx += tx * tangentForce;
vy += ty * tangentForce;

vx += nx * outwardForce;
vy += ny * outwardForce;

The result was unexpectedly effective.

Instead of bubbles merely appearing on top of the artwork, streams started dividing around them. Groups of bubbles produced channels. Pigment accumulated around their edges and then rejoined further downstream.

Suddenly the bubbles were helping to create the composition.



Gold behaves differently

The gold became another little experiment within the experiment.

I didn’t want it evenly distributed throughout the image. In the physical ornament it feels more like a sediment: something heavier that collects in particular places.

So the gold particles have their own behaviour.

They follow the same underlying flow, but respond more strongly to bubble boundaries and have a chance of being deposited when they get close to an edge.

if (edgeDistance < 8) {

  if (random(1) < 0.035) {
    deposited = true;
  }
}

It’s a tiny rule, but across thousands of particles it produces occasional concentrations and thin gold trails.

I particularly like that I don’t decide exactly where the gold appears.

The system does.



Controlled, but not designed

That’s probably my favourite aspect of this project.

I’m choosing the palette, particle density, noise scale, bubble sizes, forces and probabilities, but I’m not actually drawing the final composition.

Every regeneration produces a different result.

Some are balanced.

Some are chaotic.

Some contain huge empty areas.

Some become almost completely overwhelmed by colour and bubbles.

And occasionally one appears where everything happens to come together.

There’s something pleasingly similar about that process to turning over the original ornament and waiting to see what happens.


From simulation to artwork

Once I started getting outputs I liked, I realised they worked surprisingly well away from the Processing window.

At 1600 × 1600 pixels they’re naturally suited to square digital artwork, but the detail also makes them interesting as prints.

I’ve experimented with them as large square framed pieces, groups of three prints, desktop artwork and phone wallpapers. Cropping into the images also reveals smaller compositions that I hadn’t deliberately created.

That opens another interesting possibility: generating at a much larger resolution and treating the resulting image almost like a landscape, finding compositions within compositions.

The artwork could equally become animation. Instead of saving the final particle paths, the movement itself could become the work: pigment slowly flowing around bubbles, separating and collecting before eventually settling.


Back to the desk

What I like most is how circular the whole experiment feels.

A fairly simple ornament sitting beside my computer reminded me of being on holiday in the 90s and watching these things with my dad.

Thirty-odd years later, I’m looking at the same object and wondering how its behaviour can be translated into Perlin noise, particles, collision detection and Processing.

The finished images aren’t really simulations of oil and sediment.

They’re interpretations of it.

Gold, sediment, waves and oil — translated from something physical into a set of rules, then handed back to chance.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *