Home Creators Posts Import Register Favorites Logout

Content

Now that we've created our basic grooms in Maya and Houdini, I'd like address a more advanced topic: texturing hair.

All renderers come with a hair shader that includes various settings to create realistic-looking hair. The core parameters are usually melanin and redness to control the black-red-blonde-white range of human hair, roughness, and diffuse (dye) color.

This is all fairly straightforward, but one area where complexity and confusion arises is when it comes to texturing. Some situations where textures would be needed are a character with hair dyed different colors, hair with darker roots and lighter tips, and of course patterns such as leopard spots or zebra stripes.

The key to applying textures in all these situations is understanding the two kinds of UVs:

First, there is the standard type of UV that we all know from unwrapping models for painting in Substance Painter or other apps. Interactive Groom and Houdini Hair Generate pick up the UVs from the mesh the hair is created on, allowing us to project textures onto the hair the same way we would onto the mesh. This is perfect for dye jobs and animal prints.

Second, there are implicit UVs (also called barycentric) which run from root to tip. This is what we need for applying gradients along the length of each hair.

Let's look at how the native renderers in Maya and Houdini handle both types of UVs.

Arnold

Arnold picks up our UVs easily via Interactive Groom. Let's say we wanted to have different colored hair on the top and sides in our groom.

We can use Maya's built in paint tool to quickly create a color map and save it to disk. (I'll cover the paint tool more in the next article about creating maps for Interactive Groom.)

Next, assign a new aiStandardHair material to our hair Interactive Groom collection.

Connect an aiImage node to the Base Color channel of the hair shader and point it to the desired texture.

Set Melanin and Melanin Redness to zero to start, then start increasing the values on one or both until you get the look you want. I also added an aiColorCorrect to the texture. You'll never get exactly the color in the original texture since there is so much scattering in hair, so it's common to color correct it to dial in the look.

Now let's say we want to have darker roots. In Hypershade or the Maya Node Editor drop down an aiRampRgb and set Use Implicit UVs to on. The left side of the ramp corresponds to the roots of the hairs, so let's go from black (or dark grey) to white. Add an aiMultiply to multiply our dye job by the ramp values and we'll get a nice gradient. Looks good!

Karma

The concepts we discussed above apply to Karma, but the technique is a bit different. Let's bring our Houdini groom and head model into Solaris using SOP Import nodes. Add an Environment Light, a Material Library and a Material Linker.

Dive into the material library and create six nodes: Karma Hair, MtlX Image, MtlX Color Correct, Usd Prim Var Reader, MtlX Color Ramp and MtlX Multiply.

Jump back up to the top level stage and use the material linker to assign the new kma_hair1 to our groom (sopimport1 in my case).

Now go back to the material library and in the Usd Prim Var Reader set the attribute to curveu.

This is the attribute we created during the grooming process that assigns ordered numbers from 0-1, root to tip, on each curve. These are our "implicit" UVs.

Connect the Usd Prim Var Reader to the MtlX Color Ramp and connect that the baseColor input on our hair shader. Set the ramp to black to white, similar to the one we created in Arnold.

Set Melanin and Melanin Redness to zero to start. Fire up a Karma render and we see that each hair is now dark near the roots and light at the tips, as we wanted!

We can also assign the dye texture we created in Maya and multiply it by our ramp. Simply import that into our MtlX Image node and wire everything up as shown. Since we told our hair generate node to import our mesh UVs during grooming everything should display correctly out of the box. I played with the MtlX Correct Correct to help get the colors right, increasing melanin and melanin redness as needed to get a nice look.

Closing Thoughts

Most other renderers should follow a very similar workflow to Arnold and Karma. UVs for texture maps and implicit UVs for root to tip gradients are standard. You should be all set to get similar results no matter which software you use. Consult your renderer's documentation if you need some tips on the specific workflow they use. Enjoy!

Files

Comments

No comments found for this post.