06.07 · 3D & Advanced

WebGL Shader Animation

Moving color patterns computed for every pixel. Best for bold backgrounds.

Watch it

It moves by itself. Pause it to look closely, or turn on slow motion to see each part of the movement.

Try it

Change a setting and see the difference as it moves.

Pattern

Four patterns, each one short formula.

Speed

How fast the pattern moves.

More optionsFewer options

The pattern bends around 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 a moving shader pattern to [the background or section you want it in]. Cover the area with one WebGL surface and write a fragment shader that works out the color of every pixel from its position and the time, so the whole pattern moves as the time runs on: flowing plasma, rippling waves, cells or a kaleidoscope. When the settings include it, let the pointer, or a finger on touch screens, bend the pattern near it. Draw fewer pixels on phones, and show a clear message where WebGL is not available. If the visitor has reduced motion turned on, show one still frame. 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
  • Music and events
  • Loading screens
  • Art pages

Avoid on

  • Behind text
  • Low-power devices