06.05 · 3D & Advanced

Fluid / Liquid Simulation

Blobs drift and melt into each other like liquid. Best for hero backgrounds.

Watch it

It moves by itself, and one blob follows your pointer or finger. Pause it to look closely, or turn on slow motion.

WebGL not available in this browser.

Try it

Change a setting and see the difference as it moves.

Melting

How far apart two blobs start to melt together.

Number of blobs

More blobs meet and merge more often.

Speed

Slow feels calm, like a lava lamp.

More optionsFewer options

Blob size

Bigger blobs touch and merge more.

Color

The color of the liquid.

A soft halo around the liquid.

Moves one blob to your pointer or finger.

Copy the prompt

Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.

Add liquid blobs to [the section you want them in]. In a WebGL fragment shader, work out for every pixel its distance to each of a few moving circles, and blend those distances with a smooth minimum so circles that come close melt into one shape with soft necks between them, like drops of mercury. Move the circles on looping paths so they keep merging and separating; one can follow the pointer or a finger. Every pixel is checked against every circle, so draw fewer pixels on phones. If the visitor has reduced motion turned on, show the blobs still. Match the settings listed below.

Replace the words in brackets with your own element. Your settings are added at the end.

Free and open source. If this helped, a star on GitHub helps other people find it.

Star on GitHub

What it is

The full explanation is in README.md.

Good for

  • Hero backgrounds
  • Wellness brands
  • Creative studios
  • Splash screens

Avoid on

  • Behind text
  • Small elements