Explore a mesmerizing world of fluid dynamics rendered in real-time. Move your cursor to interact with the liquid simulation powered by WebGL shaders.
Built with cutting-edge WebGL technology for stunning real-time liquid simulations.
Fragment shaders run directly on the GPU, enabling smooth and complex liquid simulations at 60fps.
Organic blob merging using mathematical metaball functions creates realistic fluid behavior.
Mouse tracking creates a responsive blob that follows your cursor in real-time, blending with the animation.
Automatically adapts to any screen size while maintaining smooth performance across all devices.
This animation uses a metaball algorithm implemented as a WebGL fragment shader. Multiple invisible spheres (blobs) float across the canvas. For every pixel on screen, the shader calculates the influence of each blob based on its distance.
When blobs get close enough, their influence fields overlap and merge — creating the characteristic "liquid merging" effect. The colors are generated dynamically using HSL color space, producing smooth rainbow-like gradients.
float metaball(vec2 p, vec2 center, float r) {
float d = distance(p, center);
return (r * r) / (d * d);
}
// Sum influence of all blobs
float total = 0.0;
for(int i = 0; i < NUM_BLOBS; i++) {
total += metaball(uv, blobs[i], radii[i]);
}
// Apply threshold → liquid surface
if(total > 1.0) {
gl_FragColor = mix(color1, color2, total);
}
Explore the source code and build your own liquid animations. Open source and free to use.