Hair using Geometry Nodes

I tried making hair with geometry nodes.

Not sure how similar is this to your method, but to summarise I calculate the position of the different points of the curve individually. This allows for true interpolation between the guiding curves. (Not in this file)

2 Likes

@Xeofrios This is very interesting! Particularly the interpolation effect you have made, without using any barycentric coordinates.

Thank you for sharing!

Thanks! Would it be fine if I post updates on this topic? Also please don’t refrain from implementing features from my method that you like into your own.

1 Like

I tried the file,I feel like that for a interpolation method,we should use a region mask to define where hairs grow instead of radius.

1 Like

Also,the current interpolation still generates some hairs from each guide(seems to be affected by duplication count),true interpolation(such as 3 point )would be nice.

@Xeofrios, you are always welcome, to post your updates. Thank you.

@TheWhisper yes, this is probably best way to control the interpolation by using some kind of hand painted Id maps.

Thanks for your feedback!

There is an option for using vertex groups. You could theoritically set the radius to a large value for the effect you want. I will make sure make it an option for future versions

Yes that was intentional for some edge cases. It will not be necessary now.

It will better to use texture mask instead of vertex group (in the case of a low poly mesh vertex group won’t be precise enough)

I am not sure if texture masks would be any more useful than vertex groups in GN, as you are always bound by the mesh density. (As the data is stored by the vertices)

2 Likes

Even so I think texture map may still be better,at least for the painting process.Will subdivision on the mesh have a big performance impact?

Subdivisons will be fine (performance wise), but I think it will result in more tighter interpolation

1 Like

Why would that happen ? mathematically the density of point should be even in a given Y coordinate.(In the case of two curve,the generated curve should be a*curve1+(1-a)*curve2,a is evenly chosen from 0 to 1)

It’s an artifact of the method I am using. I first transfer the position of the guide to scalp and then transfer that to the child curve. Ideally it should have been something like (curve1/distance1 + curve2/distance2 + curve3/distance3…) * sum of all the distances. But I couldn’t find any way to do it without any form of lists.

Ideally for this transfer method all guides should be on the same Polygon.

One Issue with 3 point coordinate method is that there is currently no way of defining the triangles. This will be probably possible if we get some kind of Delaunay Triangulation Texture Node. But then maybe I am just missing something.

1 Like

Moved to a node based approach


Most of the inputs are intuitive. Some which are not so obvious-

  • The radius of the simple children is a vector, each value referring to an axis in the curve space
    image
    (x and y can switch directions in some cases, mostly with bias resolution turned on. I would not recommened using the z (tangent) axis)

  • Bias resolution- adds more resolution curve root and tip

  • The clump values are meant to used with field values

Here is what a node tree might look like. I wouldn’t recommened putting many hair systems on the same object as in the example.


A majority of the nodes are spline parameter followed by color ramps to drive different values

Here is a new demo with curl modifier





hair test.blend (1.1 MB)

12 Likes

I plan to add a smooth attribute node to sort-of get around the problem. It has some performance issues right now.

2 Likes

What Blender version do we need to test this? Will the nightly build work?

Yes, I think any build from this week would work.

1 Like

Got smoothing working


The smoothing is proprotional to the (average) number of faces between two adjacent guides. That also means that denser geometry takes longer to evaluate. In my demo file above, the average number of faces between two guides is 1, so it is almost as fast as before.

4 Likes

Does it use random distribution ?I think even distribution would be nice for hair(xgen uses even distribution).