Ferrofluid Lab simulates the mesmerizing behavior of ferrofluid — a colloidal suspension of magnetic nanoparticles that forms dramatic spike patterns when exposed to a magnetic field. The shader recreates the Rosensweig instability, where surface tension competes with magnetic body forces to produce regularly spaced conical peaks.
The simulation models the normal-field instability using displacement mapping driven by magnetic field strength calculations. Each spike emerges from the interplay of magnetic pressure, surface tension, and gravitational restoring force. The metallic appearance uses environment mapping and Fresnel reflections to capture ferrofluid's characteristic dark, mirror-like surface.
Interactive parameters include magnetic field strength, spike count, surface tension coefficient, and viewing angle. The effect responds to mouse position as a virtual magnet, allowing direct manipulation of the spike pattern formation.