Hair Procedural random ID's

   2135   5   1
User Avatar
Member
1533 posts
Joined: March 2020
Offline
Hi
I'm trying to assign random colours to the hair procedural, but not having much luck.
I've already randomized the id's at SOP level since I couldn't figure this out at shader level. no MtlX randomize?

What should I add in the PrimVarReader? "id" works on the guides render, but doesn't seem to on the procedural.
I did add "id" to the Attributes to Copy on the Hair procedural, but not sure how to access this from the shader?
Thanks
J

guides


render

Attachments:
guides.jpg (246.7 KB)
render.jpg (320.2 KB)

HOD fx and lighting @ blackginger
https://vimeo.com/jasonslabber [vimeo.com]
User Avatar
Member
8000 posts
Joined: Sept. 2011
Offline
I don't believe there is one. The hair shader has a randomize function, but uses an internal id generator. ID on guides is useless since multiple guides are interpolated to each generated curve. The procedural sop network would be tasked with creating an id primvar at run time, but I don't think it does.
User Avatar
Member
1533 posts
Joined: March 2020
Offline
O thanks man, pitty there isn't a option on the procedural, at least I wasn't missing something obvious..
Yeah I figured there would be some interpolation issues, and would end up in a sort of clumped look, but was curious to try.

Pity the hair shader doesn't have a bit more control for randomization, I'm using the Diffuse component, which doesn't randomize.

Guess one could always send off some RFE's
HOD fx and lighting @ blackginger
https://vimeo.com/jasonslabber [vimeo.com]
User Avatar
Staff
4193 posts
Joined: Sept. 2007
Offline
The procedural does output primvars:idon the Procedural Prim curves. I think the problem is the int to float connection, which for some reason isn't just auto-converted in every case? Also generating simple random numbers for Karma/MaterialX in-shader is more awkward than it should be, we're working on it.

Hope this helps in the meantime.

Attachments:
hair_proc_ids_material.jpg (58.6 KB)
hair_proc_ids.hip (363.4 KB)

I'm o.d.d.
User Avatar
Member
1533 posts
Joined: March 2020
Offline
o wow, thanks for this Chris!
Yip agreed, simplifying creating random samples would be great!
HOD fx and lighting @ blackginger
https://vimeo.com/jasonslabber [vimeo.com]
User Avatar
Member
621 posts
Joined: Aug. 2008
Offline
try fabio https://www.sidefx.com/forum/topic/92598/ [www.sidefx.com]
it use the materialX ready for gpu and in the nodes randomize for the curves
  • Quick Links