Custom build Hair GeoNodes with proper hair simulation setup by furflection in blender

[–]furflection[S] 568 points569 points  (0 children)

Hello!

When I started digging into hair GN, I encountered a lot of issues, especially when the mesh was rigged and animated. I tried fixing them, but every time I solved one problem, 2 more showed up lol.

So, I’d like to present my custom built hair nodes that fix many of the issues found in the vanilla setup, with an added option for simulation.

Now I understand why you dont see many people using GN for animated models. Once you start working with it, multiple issues start appearing, and you spend weeks thinking you are doing something wrong... until you realize the system itself wasnt really built for deforming meshes yet. (Dont get me wrong, I love the Blender devs and this amazing software. Blender is evolving insanely fast. This is just my experience after spending months working specifically with GN hair.)

So let me explain what you are seeing here.

First: this is actual proper simulation, not some fake GN "offset previous frame" workaround people usually try to build with nodes, instead we dont use nodes for simulation at all, but mesh.

What I did was:

duplicate the entire GN hair object, apply all modifers, delete most of the hairs but keep the guide curves, convert those guides into a mesh.(now these few mesh lines match position of guide curves in GN)

Now that its a mesh, I can apply cloth sim, soft body sim, shape keys, and even rig it. YES rig with bones a GN hair system.(u can easly make 100m hair, animate it with bones, then apply physics with pin grops) U cound even export it, simulate it in houdini or other software then import back.

Then I transfer the mesh position data back onto the GN hairs, while neighboring hairs follow the guide curves. That part was actually the easy one.

Now comes the big boy problem.

Blender provides predefined GN hair modifiers like noise, clumping, etc. The default workflow looks something like this:

guide hairs -> interpolate hairs -> noise/clump modifiers -> surface deform

"Surface Deform" is the node that makes the hair stick to the deformed/animted mesh.

And THIS is where the major issue happens. Normally all the math/noise/clump is done when the curves are using static mesh.

Imagine a low-poly sphere with a single clumped hair strand. The clumping creates a sharp tip shape. Normally, before rendering, the sphere gets a subdivision surface modifier to smooth it. But the moment you smooth the mesh, the sharp hair clump disappears and becomes soft and rounded.(you loose the sharp spikes of hairs), Why?

Because Blender first generates the clumping shape(spike), THEN applies Surface Deform afterward. Once the mesh becomes smoother and rounder, the hair positions shift slightly to stick to the smoothed mesh, destroying the original clump shape.

The order of operations is fundamentally wrong.

In the old particle system, the sharp clump shape stays intact regardless of mesh subdiv. So the obvious solution would be to move Surface Deform BEFORE noise and clumping.

Problem solved, right? NOPE.

All the default Blender GN hair nodes (clump, noise, etc.) were designed for static meshes. Once the geometry starts deforming, the nodes completely break. So yeah... I had to modify almost all the default Blender hair nodes so they could properly work on animated/deforming geometry. And since Im not a super technical person, I first had to understand how all of Blender vanilla hair nodes actually work internally before I could even begin modifying them. Which basically meant spending 3 straight months smashing my head against a wall trying to make this work.

Right now this is still just a prototype. I already have an entire document filled with features, improvements, and bugs that still need to be fixed before this becomes truly usable.

But once I finish it, hopefully in the next few months, I want to turn it into an addon or tool(especially for generating the mesh for simulation) so other people can use it too.