Improving Arnold's Hair Shader

192 views
Skip to first unread message

Francis Bezooyen

unread,
Oct 3, 2022, 7:04:36 PM10/3/22
to gaffer-dev
Ok, this isn't really a gaffer question but I am hoping someone here might be able to point me in the right direction.

I am dissatisfied with the Arnold hair shader. Especially on thickly furred creatures, I find that even with moderately closeup shots I notice the difference in shading that arises from the fact that what's being rendered are ribbons rather than tubes. I know I can render my curves as tubes, and this does improve the look when closeup, but then it all falls apart when you pull the camera back - the hair shader really doesn't work properly with tubes.

I'm going to work on this problem on my own but if any of you have some useful suggestions I'd love to hear them.

dan...@image-engine.com

unread,
Oct 4, 2022, 8:09:40 PM10/4/22
to gaffer-dev
There's not really enough detail here to know what appearance you're trying to achieve.  It's been a while since I've played with Arnold's hair shader - you say there's a difference in shading between ribbons and tubes - I think this difference is expected because docs say that the hair shader is not intended for use on tubes, so it's probably just looking broken when applied to tubes.

What are you wanting to see in a medium closeup on a thickly furred creature?  Is it a cartoon or realistic style?  On realistic hair, even extremely closeups don't really look very tube like, because it's so translucent.  The only part which really does reveal the tube shape is the first specular reflection - if you were trying to render microscope images of realistic hair, you'd probably want to remove the first specular reflection from your standard hair model, and replace it with a basic hard surface spec model using the tube normal for the first bounce, and then use everything else from the standard hair model for transmission and secondary bounces.  If you're rendering a mix of microscopic and normal scale shots, you'd probably need to blend back to the standard model when the hair is small on screen, because the hard surface spec model on a tube is going to require a huge number of samples to get clean.

-Daniel Dresser

Francis Bezooyen

unread,
Oct 8, 2022, 9:28:27 AM10/8/22
to gaffer-dev
Thanks for answering Daniel.

I have already made some attempts to combine the results of both tube and ribbon shading. However, the way you are describing how to do it suggests that you are recommending that I extract data from shaders in ways I am not familiar with. Can you describe how you would do it?

Daniel Dresser

unread,
Oct 13, 2022, 12:27:02 PM10/13/22
to gaffer-dev
Oh, sorry for taking a while to get back to this one.

A hair shader is about combining together approximations for all the different ways light could pass through a forest of glass tubes.  Some of those are within one hair, like "reflecting off (R)", "refracting through one side and out the other (TT)", or "refracting in, bouncing around 3 times, then refracting out (TRRRT)".  Some of them are about bouncing back and forth between other nearby hairs.  Of all these approximations, the only thing that would really make sense to affect with the tube normal is the very first "(R)" lobe.  So in theory, you'd want to turn off just that lobe and replace it with a simple rough reflection ... however I don't think there's really any way to do exactly this with the Arnold ( it would be sort of like setting `spec` to 0 and just keeping `spec2` on the Arnold shader, but I think that would have other side effects that would break the rest of the shading ).  Assuming you don't have your own hair shader to hack with, I guess you could just turn down a bit all the specular on the Arnold shader, and add an extra spec lobe on top with the tube normal ... it won't be particularly accurate, but maybe it would get you close to your desired look?

The other option would be just use actual tubes, with a glass shader on them.  Hair shaders are just an approximation to that ... the only reason we use hair shaders is because rendering millions of tiny glass tubes with many inter-reflections is insanely expensive and noisy.

Anyway, I'm still not sure what the goal here is ... I'm still not picturing a situation where the normal variation across the width of a hair would be visible, unless the hair is thick and cartoony, or we're looking through a microscope.

-Daniel
Reply all
Reply to author
Forward
0 new messages