How to morph particles between shapes on scroll with Three.js

Updated November 12, 2026

Generate each shape once as an array of positions, give the geometry two position attributes (the current shape and the next), and blend between them in the vertex shader with a single uniform that scroll controls. Morphing then costs one number per frame instead of re-uploading tens of thousands of points.

What makes it look expensive rather than like a crossfade is a random delay per particle. Each particle starts its journey at a slightly different moment, so the change sweeps through the cloud like liquid.

1. One cloud, two position attributes

Build every formation as a Float32Array with the same number of points. Put the current one in the `position` attribute and the next in a second attribute, and in the vertex shader compute `mix(position, nextPosition, k)`. When scroll crosses into the next segment, swap which arrays the two attributes point at.

Use THREE.Points with additive blending and depth writing off. Keep the points small and dim: thousands of tiny points read as premium, while large bright ones saturate into a white blob.

2. The per-particle delay

Store a random number per particle in an attribute. Compute each particle's own progress as `clamp(mix * (1 + S) - delay * S, 0, 1)` and smooth it. With S around 0.5 the first particles leave early and the last arrive late, and the shape appears to pour from one form into the next.

For extra life, push each particle outward along a random direction by the sine of its progress, so it travels on an arc instead of a straight line.

3. Time the morph to the chapter boundary

The mistake everyone makes first is morphing inside each section. Every section then shows the previous shape while its text is on screen. Start the morph while the next section is still below the viewport and finish it as that section reaches the top, then hold the finished shape for the whole time its copy is being read.

4. Let each shape turn on its own

Rotate the two shapes separately in the shader before blending them, each with its own angle. A wheel can then spin in its plane while the next shape only sways. If you rotate the whole cloud with one shared angle, shapes have to unwind between chapters.

5. Turn text or a glyph into particles

Draw the glyph to a hidden 2D canvas in a web font, read the pixels, and place particles on the filled ones. Put about half on edge pixels so the outline stays crisp. Wait for the font to load first, or you will sample the fallback font.

For solid shapes generally, put 30 to 50 percent of the particles exactly on the outline. A uniform fill reads as fog.

6. Phones and accessibility

Cut the particle count to roughly a third below 768 pixels wide and cap the device pixel ratio. For visitors who ask for reduced motion, stop the time-based animation and skip the text effects; the scroll-driven change of shape can stay, because the visitor controls it.

Frequently asked

How many particles can Three.js animate smoothly?

With the positions blended in the vertex shader, around ninety thousand points run comfortably on a laptop and about thirty thousand on a phone. The cost is on the graphics card, so the count matters less than the size of the points on screen.

Should I use React Three Fiber for this?

You can, but plain Three.js in a client component is simpler here: one canvas, one Points object, one render loop, and you control exactly when attributes are swapped.

Why does my particle shape look like a blur?

The points are too large or too bright for additive blending, or the shape has no defined edge. Shrink the points, lower the brightness, and place a share of the particles exactly on the outline.

Is there a working example I can copy?

Yes. The Nova and Trimurti templates in this studio are built this way, and each gives away its full Claude Code build prompt: the opening is on its page, and signing up for a free account unlocks the rest.

Templates built this way

More guides