Flow Field Particles — a GPGPU particle sketch in three.js

Hundreds of thousands of particles are simulated entirely on the GPU: three.js's GPUComputationRenderer keeps a position texture and a velocity texture and ping-pongs them every frame, with the alpha channel of the position texture storing a per-particle random seed. Velocities are advected by 4D simplex noise, the fourth dimension being time, so the flow field evolves rather than scrolling. The eight presets — Dust, Caravaggio, Van Gogh, Abyss, Pulse, Helix, Nova and Morph — swap the target point cloud, sampled from a mesh surface, from a scanned PLY or from the luminance of a photograph, and the cloud is interpolated toward it in the compute shader. A bloom pass, a depth-of-field pass and a ping-pong persistence trail give the streaking, and the pointer pulls the cloud around through a smoothed world-space velocity.

Source code: particles-shaders on GitHub. More work: all WebGL demos by Niccolò Fanton and Niccolò Fanton's portfolio.