Karma Hair shader - Tip / Root color

   5467   1   2
User Avatar
Member
8 posts
Joined: Sept. 2019
Offline
Hey everybody!

I'm trying to render hairs with Karma and I can't manage to get the "Karma Hair shader" to have a different root / tip color.
I tried binding the point attribute "curveu" and colonizing it by using a ramp node, but I couldn't make it work, I tried binding the "curveu" attribute with many different nodes (USD prim var reader,bind node, mtlx geom prop value, point attribute).

Is it impossible to have different root / tip colors with the karma hair shader?
is there something wrong with the way I import/bind the attributes?

Thanks for the help!

Attachments:
Screenshot 2022-04-10 011026.png (99.9 KB)
Screenshot 2022-04-10 005851.png (115.6 KB)
test_scene_v001.hiplc (1.8 MB)

User Avatar
Member
8184 posts
Joined: Sept. 2011
Offline
nitzo1
Is it impossible to have different root / tip colors with the karma hair shader?
is there something wrong with the way I import/bind the attributes?

The problem is you're mixing and matching nodes. The karma hair shader is only compatible with usd and mtlx nodes. The vex (mantra) nodes won't work. I.e. the ramp node is not allowed. There is an mtlx ramp node that was added for karma.

Connect the geompropvalue node to the mtlxhrampc node to remap the curveu primvar to color. Alternatively, with karma CPU only, use a mtlx dot node to read the 'ray:hituv' vector property and get the y component to connect to the ramp. Unfortunately this render property doesn't work with XPU.

Edit: It's also possible to connect a geompropvalue for 'width' to the thickness scale parameter to control the color through natural melanin attenuation.
Edited by jsmack - April 10, 2022 11:58:25

Attachments:
hair_test.hip (1.7 MB)
karma_hair_width_color.png (1.1 MB)

  • Quick Links