Help - Search - Members - Calendar
Full Version: Using the new Hair Shaders
Hash, Inc. Forums > Technical Direction and Development (Learning Animation:Master) > A:M Rendering, Compositing and Special Effects > Materials Laboratory > Hair
cosmonaut
I will be posting more details in the future, for now I'm going to just give the basics (I'm at work so I can't make any pretty pictures to illustrate with).

There are 2 new shaders built in to V!3 of Animation Master, the Kajiya-Kay shader and the muhHair shader. Both shaders are aimed at improving the quality of actual hair shading (animal or human), i.e. it's best not to try and use for grass or feathers.

The Kajiya-Kay shader was the standard hair shading model for many years. It provides fairly nice results and is fairly efficient. One of the main benefits of this shader is that it provides backlighting for free, i.e. no need to try and use translucency. It's not nearly as flexible or realistic as the muhHair shader and it doesn't provide any controls but it renders faster. The shader is based on the phong shading model adapted for hair and thus provides a diffuse component and a specular component that works the same as the standard AM materials.

The muhHair shader is quite a bit more complex. It's a simplified version of the Marschner hair shader (which I'm working on for V14) and is best at giving that "pantene" look. It was originally an XSI shader written by Daniel Rind. The basics are there are 3 specular components and one diffuse component (which isn't really necessary except for shorter hair). The 3 specular components are known as the primary, secondary, and translucent components. The primary specular component is the standard white specular highlight gets it's color from the specular color in the surface properties. The secondary specular component makes up most of the actual color we associate with the hair and actually gets its color from the diffuse color you've defined for the hair. The translucent component provides the backlighting for the hair and also gets its color from the diffuse color defined for the hair.

To use the new shaders go to your hair material->hair emitter->surface and set the diffuse and specular render shaders to both be either muhHair or Kajiya-Kay (doing only diffuse or specular won't work properly). When doing so face camera will be set to 100% and bow will be set to 0% and both properties will be disabled.

That's it for now...stay tuned for details on all the muhHair properties

Kevin
Kricket
Thanks!
heyvern
Holy crap...

I have been out of the loop...

Someone mentioned muhair in another thread... I thought it was either a misspelling or... some kind of "mullet" reference... like a new "mullet" shader or something.

This sounds like fun!

dang... have to use the PC again...

need... to... upgrade... to... Tiger... aarrgghh... so... hard... to change...

-vern
Far Star Productions
Kevin,
This is great. Thank you very much for the Tut on how to use and I look forward to seeing what you have to say about properties settings.
NancyGormezano
QUOTE(cosmonaut @ Jul 12 2006, 03:06 PM) *

The secondary specular component makes up most of the actual color we associate with the hair and actually gets its color from the diffuse color you've defined for the hair. The translucent component provides the backlighting for the hair and also gets its color from the diffuse color defined for the hair.
Kevin


Does using a decal to drive the diffuse color work with these shaders ? (they do sound nice)
cosmonaut
QUOTE(NancyGormezano @ Jul 13 2006, 05:13 PM) *

Does using a decal to drive the diffuse color work with these shaders ? (they do sound nice)


Yep. And I'll be getting to describing the properties soon.
John Bigboote
Hey Kevin-

I tried applying muhair and kayija kay in V13C to models I had made and 'haired' in 11 and saw no difference... do you need to originate the hair in 13 to get the 'magic' to happen?

Also- do these shaders work on hair that has an image applied to it?

Looking forward to more info...and appreciate your work..

cosmonaut
QUOTE(John Bigboote @ Jul 20 2006, 01:26 PM) *

Hey Kevin-

I tried applying muhair and kayija kay in V13C to models I had made and 'haired' in 11 and saw no difference... do you need to originate the hair in 13 to get the 'magic' to happen?

Also- do these shaders work on hair that has an image applied to it?

Looking forward to more info...and appreciate your work..


They should work fine, I've applied them to older models and they've worked. Make sure you've enabled plugin-shaders in the rendering properties. That would be the only reason they may not be showing up for you. You should also make sure you key light/rim lights have specular shading enabled, especially for muhHair. Also, there is a bug (which I think you actually pointed out) so when using the new shaders that should cause some dark rendering patches to show up. This is fixed in the next version I believe. And yes, they should work with hair with images, though I haven't actually tried that myself.
cosmonaut
A little late but here goes: below is the description of the different muhHair properties (note some of this is taken from the original muhHair documentation):

Diffuse Properties
  • Diffuse Blend - Allows you to smoothly interpolate between a long and short hair shading model. A value of 0 means that a long hair model will be used, and maximum highlight/diffuse shading is achieved at glancing angles. A value of 1 means that a short hair model will be used, and diffuse/specular shading will approximately follow that of the underlying surface.
  • Diffuse Strength - Defines the percentage of the overall diffuse contribution


Specular Properties
  • Primary Width - (aka shininess) Defines the width or size of the primary highlight. The highlight is a simple gaussian bell curve, centered on the optimal reflection direction. It is a bit different from other shading models in that the peak intensity does not increase when you raise the shininess, only the extent of the highlight gets smaller. This makes it easier to tune the highlight size while keeping the brightness constant.
  • Secondary Width - same description as primary, only applied to the secondary highlight. Should typically be the widest.
  • Translucent Width - same description as primary, only applied to the translucent highlight
  • Primary Deviation - This specifies a shifting of the highlight from the specular reflection position towards the root or the tip of the hair. Negative values shift towards the root, while positive values shift the highlight towards the tip of the hair. The primary highlight is typically shifted towards the tip of the hair slightly.
  • Secondary Deviation - same description as primary, only applied to the secondary highlight. Typically shifted towards the root of the hair.
  • Translucent Deviation - same description as primary, only applied to the translucent highlight. Typically shifted towards the root of the hair.
  • Primary Strength - Defines the percentage of the overall primary highlight specular contribution
  • Secondary Strength - Defines the percentage of the overall secondary highlight specular contribution
  • Translucent Strength - Defines the percentage of the overall translucent highlight specular contribution
  • Index of Refraction - Sets the hair IOR. Normal hair has an IOR of about 1.55 - 1.6. The IOR is only used for computing a Fresnel falloff for the primary and secondary specular components.
  • Fresnel Strength - Primary and secondary highlights are affected by a Fresnel falloff. The primary specular will have maximum intensity at the borders, and fade towards the center, while the secondary specular will have maximum intensity at the center and fade towards the borders. The strength sets how much the highlights are actually affected by this falloff, with 0 meaning they aren't affected at all, and are constant across the hair width, while 1 means full Fresnel falloff. If you set this too high, you will likely get bad aliasing effects, so try to keep it low.
  • Direction Attenuation - This sets a direction attenuation for the specular highlights. The primary and secondary highlights will have maximum strength when you look at the hair from the same direction the light is coming from, and minimum intensity when you look at the light through the hair. For the translucent highlight, it's just the other way round: Maximum intensity when the light is shining through the hair towards the camera, and minimum intensity when you are lookin at the hair from the same direction the light is coming from. The direction attenuation setting allows you to set the amount of fading that occurs. 1 means full attenuation, and 0 means no attenuation.
  • Specular Blend - Allows you to smoothly interpolate between a long and short hair shading model. A value of 0 means that a long hair model will be used, and maximum highlight/diffuse shading is achieved at glancing angles. A value of 1 means that a short hair model will be used, and diffuse/specular shading will approximately follow that of the underlying surface.
johnl3d
In Case someone wants this I printed this into a pdf file


[attachmentid=19180]



rolleyes.gif
cosmonaut
Cool John, thanks for doing that...
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.