3
$\begingroup$

In short: I need a method to get the new hair curves system to get the color from the emitter mesh, just like a regular hair particle system works. With a particle system, you can easily just set the material and it will grab the color from the root of the strand.

That's important, otherwise this happens:

Strand color

Here I have an example emitter mesh to show what I mean. Emitter mesh

Here I apply an old hair particle system. This is the desired result, long hairs stay the correct color along the strand. Old Hair Particle System

Here I add a new hair curves system. As you can see, the strands change color along the curve, which is my problem. New Hair Curves

Here is the node setup I have so far. First I transform the curves into geometry. I use a "Transfer Attribute" node set to nearest face interpolated to transmit the UV data of the emitter object. But I am not very experienced with geometry nodes and do not know if there's a better or intended way to do it, as I have found 0 information on this. All tutorials I've found so far seem to use a solid color along the entire hair. Node Setup

Here is another solution attempt that did not work out, but comes very close. I tried simply applying the geometry nodes, turning the UV attribute data into an UV map, and then scaling every hair "UV island" by 0, with the individual origins option, therefore turning every uv map into a singular point so the color would be all the same. This has problems though, particularly with seams. Hair Curves 2

The problem with this is that if your uv map has separate islands, I cannot just make the UV map center the strand on the root, it will just be a middle point. If I could make it center the UV "point" on the origin root, that would solve this issue, but I cannot find a way to do that for the millions of hairs generated. This problem results in random black hairs. Black hairs

Here's an example of the resulting issue. In the UV seams of the emitter model, we get these black rings, which is problematic. Example mammoth

The reason I'm turning the hair into real geometry is to use it in baking textures, regular hair systems and curves do not show up in bakes, I believe. Does anyone know of any possible issue or another method to do this with the new hair curves?

$\endgroup$

1 Answer 1

4
$\begingroup$

Answer found: Use this surface_uv_coordinate attribute in the material.

nodes

Note: this only works if you are using a newly made hair curves object. If you are using an old converted particle system, you can fix it by adding the surface_uv_coordinate attribute (spline/2d vector), and then in sculpt mode, snap to nearest surface function, that will fix the data. Thanks to Cage Claypool for helping me figure this out.

$\endgroup$
1
  • $\begingroup$ You're allowed to accept (tick) your own answer.. That will help others see it's cleared up. $\endgroup$
    – Robin Betts
    Nov 26, 2022 at 11:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .