In my searches for the more advanced hair shading techniques, i stumbled upon the full paper that discussed the sorting technique from before. It cleared a few things up, but also demonstrated a Kajiya-Kay specular lighting technique with a few ideas taken from Marschner. So I stole it (for learning of course). Here is my previous implementation on the left and Kajiya Kay on the right. The differences are subtle, mostly manifesting in a differently colored highlight and the ability to shift the highlight along the hair. 
EDIT: I finally came back and figured out Ambient Occlusion with transparency. It improves hair layering quite a bit. Before and After:
In order to generate Ambient Occlusion with an alpha map, you have to follow a slightly hacky procedure: First assign your texture with alpha to a lambert material and unlink all lights in your scene. Next, add some shadow casting ambient lights. Cast shadows are off by default, so you will need to check the options. I used 4 to surround the hair from above, but you will probably need more for objects like trees. Here is my baking setup, ugly alpha sorting and all:
Next, go to the texture bake set and set it to bake ‘Light Only’ – higher samples generally looks better, everything else is pretty irrelevant. Finally, open the Mental Ray Baking Options and and ensure bake shadows is checked before baking your lighting. And you are done. Oddly enough this tends to bake faster than true Occlusion, even on high sample amounts. WTF Maya?I’ve updated both these and my previous anisotropic hair shaders to handle ambient occlusion. I use the second UV set for Ambient Occlusion

Maya CGFX File:

kajiyakay.cgfx
File Size: 15 kb
File Type: cgfx

Download File


Unity Shader File:

kajiyakay.shader
File Size: 25 kb
File Type: shader

Download File


Leave a Reply

Your email address will not be published. Required fields are marked *