Even though I usually like to post about Compositing, I’m doing a little exception this time.
I recently had to help a student create Fur for her personal project, and I got surprised how few tutorials were present online for the Xgen/Vray Combo.
Some sort of Bug prevented us to make any progress for a long time, and even after we discovered what was causing it the process wasn’t as straightforward as we thought.
I’m writing this tutorial as a step-by-step manual for those who would also struggle to get a custom color on Xgen hair to render in Vray.
Hopefully this will be useful for some.
1- Setting up XGen to see Vray
First we need to load the Plugins. Open Maya (with a new scene) and load the plugins. Load Vray and XgenVray, then XGen.
It is necessary to load XgenVray before we launch XGen, otherwise XGen won’t see Vray as a Renderer.
2 – Create or Load your Geometry
3 – Create your XGen Fur
Well, this is not meant to be a full on XGen tutorial, so I’ll only touch the basics here.
b) Select the Geometry (or Faces) you want to grow hair on
Important! There is a bug with the current version of Maya and Vray
c) Create new Description (Create the Fur)
d) Do your Grooming or whatever you were planning to do on the hair.
4 – Color the hair
In order to color the hair, Vray uses custom shader parameters root_color and tip_color.
If you only create one of the two, the whole hair will be colorized.
a) Create the custom Map
Choose a resolution. This will be a PTex map (not UV map) and the resolution will be dependent of this value. I went for 400 sort of randomly, assuming it would be big enough. You can change it at any time by clicking the little expression icon.
At that point, you will see the sphere becoming white, and the 3D paint tool will be active.
If you want to paint the color yourself, that’s fine, click the little paint icon next to the Custom Parameter.
In my case, I want to use a texture file. If you look into the Hypershade, you will notice a texture and a material have been created for you. This does not happen if your original object had a Vray Material applied! That is the bug I mentioned earlier.
Note: The color management might not be available, in which case you’ll want a texture in Linear color.
Repeat the operation with “tip_color” if necessary. I will skip it, so my root_color will be applied on the whole hair.
5 – Render It
In order to render in Vray, I will change my renderer to Vray, and add a VrayLightDome to get some light in there.
a) Create a shader
The hair sampler is the node doing the magic, it’s not very clear to me exactly how it links to the PTex map, I’d like a bit more documentation on it, but somehow it can read some attributes of the XGen hair, and will recognize root_color and tip_color maps as such, and output them as Out color.
b) Assign the shader
c) Tweak your lighting / Shader, and Render
A magnificent hairy Earth.
Hope this Tutorial will be helpful for some. The process isn’t particularly intuitive and could be improved greatly, but for the time being we don’t have many options.
If you know a better way feel free to comment and let me know.