HairyMess is a R&D project exploring the capabilities of Compute Shaders within OpenGL.

Developed with openFrameworks, it uses the Position-Based-Dynamics algorithm (PBD) combined with a volumetric method

for hair simulation (Paper).

Inextensibility of hair strands can be computationally expensive because it takes a couple of iterations to satisfy the length constraint. This is where the Dynamic-Follow-the-Leader approach (DFTL) comes into play.

**Algorithm steps:**

*Voxel grid:*

*–Clear voxel grid
–Fill voxel grid with density and velocity
–3D convolution (lowpass filter) of density and velocity
*

*–Normalise voxel velocity and calculate density gradient*

*Strand Simulation:*

*–calculate velocity depending on friction and repulsion*

*–calculate new position*

*–calculate constraints*

*–collision detection*

Checkout source code on Github.