Random grey hairs

975 views
Skip to first unread message

Richard Potts

unread,
Jul 7, 2015, 7:05:27 AM7/7/15
to alsh...@googlegroups.com
Hello,

We are using alHair with great results, however we would like to add random grey hairs, along with sections of hair grey hairs. The bulk of the hair is black/dark brown
What's the best way of doing this? Has anyone else done similar?

Thanks,

Richard

Anders Langlands

unread,
Jul 7, 2015, 11:13:34 AM7/7/15
to Richard Potts, alsh...@googlegroups.com
Hi Richard, 

Yes it's possible, but it's a little fiddly. Basically what you want to do is get a random variable per hair and then use this to "turn on" grey hairs at a frequency you control.

The way to hook this up is to:
1) Create an aiUserData node that reads the curve_id variable from the hair. The type will depend on how your hair is generated - e.g. Uint for maya hair, Float for xgen.
2) Connect this to the signal parameter on an alJitterColor node. On the JitterColor node set input to white, min gain to 0 and max gain to 1. This will give you a random 0-1 value that is different per hair.
3) Finally connect the red channel of the alJitterColor to the mixer of an alSwitchFloat (if you're using melanin) or alSwitchColor (if you're using dye color). The random output of the JitterColor node will node randomly select between inputA and inputB. Plug your regular hair color into input B and your grey colour into input A. The threshold parameter now controls the frequency with which the grey hairs appear, e.g. 0.05 will give you 5% grey hairs.

Cheers,

Anders

--
You received this message because you are subscribed to the Google Groups "alshaders" group.
To unsubscribe from this group and stop receiving emails from it, send an email to alshaders+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Richard Potts

unread,
Jul 7, 2015, 11:53:36 AM7/7/15
to alsh...@googlegroups.com, ric...@carseandwaterman.com
Hi,

Thanks Anders, that worked great, still get to keep the melanin variation aswell.

Mjag

unread,
Jan 1, 2017, 8:13:11 PM1/1/17
to alshaders, ric...@carseandwaterman.com
I have spent sometime trying to get random gray hairs and for some reason I just cannot get this to work.
 Any more info on this process would be awesome.

Espen Nordahl

unread,
Jan 2, 2017, 2:12:55 AM1/2/17
to Mjag, alshaders, ric...@carseandwaterman.com
If you follow the process outlined in Anders's reply, that should get you there. Which part in particular are you having problems with? 

To unsubscribe from this group and stop receiving emails from it, send an email to alshaders+unsubscribe@googlegroups.com.

Mjag

unread,
Jan 2, 2017, 10:39:00 AM1/2/17
to alshaders, jagodzi...@gmail.com, ric...@carseandwaterman.com
The main issue Im having is getting the curve Id variable from Yeti.
It might be something Im overlooking.

Thanks

Aron Baaijens

unread,
Apr 1, 2018, 5:13:31 PM4/1/18
to alshaders
I'm trying to do this exact thing but with the new shaders of Arnold 5.

I'm forced to try it like this because the melanin randomness is causing faulty renders. When using melanin randomness, it looks like the curve id it uses is getting generated differently every frame.
It seems to be the like a problem Jonathan Rodegher was having (https://answers.arnoldrenderer.com/questions/2377/mtoa-xgen-flickering-lights.html).
He also solved his problem using the 'colorjitter workflow', but I can't seem to get it to work.

I have attached a aiUserDataFloat with the curve_id Attribute to the aiColorJitter Data input, with Gain min on 0 and Gain max on 1, and attached this to the melanin value of the aiHair shader. But this doesn't seem te be working.

Do you guys have any idea how I could fix this issue?
Reply all
Reply to author
Forward
0 new messages