Arnold with Hair and Fur modifier
Last Updated on 13/01/2018
I stumbled upon one yet undocumented feature that allows you to get the color from the object with Hair and Fur modifier (H&F) and assign this color to the hair itself, rendered through Custom Shader (MAXTOA).
If you assign any Arnold shader in Custom Shader parameter of H&F modifier, color of hair will be ignored on render. Color of hair will depend only on the settings of the shader, which does not have any data on the texture of the object from which the hair grows.
But as it turned out Arnold exports data H&F about hair color and transparency (root_colors, tip_colors, opacity) but does not use them when rendering. Further I will show you how to use this data to change the hair color according to the texture assigned on the object through UVW.
First, after you have added hair and fur modifier to the object you need to go to the settings Environment -> Effects-> Hair and Fur and in Hairs parameter select “mr prim”. Only in this case Arnold will visualize H&F as Arnold curves which are best optimized for the visualization of hair or fur.
The parameter “mr Voxel Resolution” does not affect the visualization of hair in Arnold.
Assign Standard Hair shader to the H&F Custom shader slot. Any other Arnold shader can be used as a hair shader.
Enable “Legacy 3ds Max Map support” to support 3ds max’s Maps. Add any Map that supports H&F to the Root Color slot. Arnold’s shaders does not support in H&F!
Now in order for Standard Hair shader to start using the hair color that we have set through the Root Color parameter you must add the Arnold shader User Data RGB.
In the Attribute parameter of this shader, you must enter the name of the data, in our case root_colors and attach this shader to the color channel of Standard Hair -> Diffuse_color.
As I said, H&F automatically exports into Arnold three sets of hair color data, what data would you use to set the color of the hair depends on your task. In this example, we’ll only use root_colors.
It is necessary not to forget in Standard Hair to change value Diffuse Weight = 1.0 forcing shader to use color data. Also in parameters H&F to change color of Root Color to white (255,255,255) otherwise color of H&F will be mixed with color of map in the same channel.
And in conclusion a few words about optimizing the rendering of hair. I want to note that by default the hair from H&F is exported to Arnold without the parameter Opaque, that is make hair transparent. So, if you do not need the calculation of the transparency of hair then you can significantly save the calculation time by adding to the object with H&F the Arnold Properties modifier and switch on Opaque in its parameters.