Tutorial: Real-time fur & hair

Bence Bodó’s Ammit is an excellent example of hair rendering on Sketchfab. I invited him to share his technique in this new Sketchfab tutorial.

There are a number of techniques for creating real-time fur, short and long hair. This tutorial is about the creation and material settings of the polygonal method that relies on having partially transparent planes (a.k.a. hair cards) with overlapping transparency textures for achieving a furry look.

Base geometry, texture map creation, blocking in the hair with a particle system.

Hair texture creation.

Hair Card placement.

Material setup.

Classic rendering

Physically based rendering

Hair texture creation

You can hand paint your hair textures (e.g. using photoshop) or do what I did for the Ammit creature, which was to render them out in a 3D package (e.g. Zbrush).

Get a simple plane, have some particle hair on it, just a few strands, make the plane itself invisible and render a color map, a transparency map (greyscale image with black parts where there would not be hairs) and a normal map from a camera looking at your scene. The color map does not need to have an alpha channel. We will drive the transparency with a separate greyscale texture, the alpha map. Make a few of these and combine them into one texture sheet.

Tips:

Place the roots of the hairs in the bottom area of the texture to help achieve a layered look.

Don’t place the roots at the very bottom in a line.

Don’t make the textures too dense.

Check that the hairs show up nicely on the texture, that you have enough pixels for their thicknesses.

For the color map don’t use black or white backgrounds, but choose a color that is dominant in your hairs/furs.

Haircard placement

Open up your base mesh (the Ammit model in my case) in your 3D software of choice. Create a sample hair card for every fur type that you have. UW map them to only have the approximate texture parts. Scale the haircards to the same size approximately as the sculpted hairs on your base geo. Set up a viewport material with additive transparency. Without this the cards will look bad, block each-other, and make the placement process a lot harder. In Maya this is done by connecting a colored texture with transparency and therefore with an alpha channel to the incandescence channel of a Blinn material. You can create this texture as a combination of the previously used ones in any image editor. Next, distribute copies, or instances of the hair cards on your base, either manually, or using a particle system, geometry painting or instancing. I did it by hand, snapping each hair card copy to the base mesh. The Ammit fur with 959 faces took only 2-3 hours and this way I had full control over placement. Finally export the hair cards as one object with a lot of individual faces.

Tips:

Have a normal map with sculpted fur on the base mesh.

Have a simple geometry for the hair, 4 vertex planes for short hair should do it, the more cards you have, the better it will look.

Place the origin/pivot point of each hair card on the middle of the bottom edge so you can easily snap and rotate the cards.

Its not a problem if the cards intersect and/or go into the base geometry a little.

Place the hair cards with less dense fur on edges of the hairy area.

Work asymmetrically in the middle areas.

Scale and rotate the hair cards on different axes for variety’s sake.

Think about rigging! With manual hair placement comes manual skinning. In some cases it is better to have a particle system with instanced hair cards attached to a rigged base mesh in order to use the skinning information of the base mesh for the hairs. E.g. in Blender you simply place the particle modifier under the armature modifier and the fur will follow the base mesh’s skinning.

Material setup. – Classic Renderer

Import your base mesh and hair mesh into Sketchfab. Connect the color texture to the diffuse channel as an RGB image with trilinear filtering.

Connect the normal map to the normal channel as an RGB image with trilinear filtering.

Connect the transparency map to the transparency channel as a luminance image with trilinear filtering. Set it to alpha blending otherwise it won’t look good. Set the transparency to a low value, like 10 to have some blending.

In order to compensate for the loss of hair visibility we will introduce some emission as well. You can use a separate texture for it as well, but I find that a solid color does fine.

For kick you can play with the spectacularity as well, I connected the transparency texture to the glossiness channel to mask out the invisible parts and used a simple solid color again. But the emission cancels out the bulk of the specular effect.

For physically based rendering I chose to follow the specularity workflow, but it does not make a real difference here. The main difference to classic rendering is that the emission can be a lot weaker.

Connect the color texture to the albedo channel as an RGB image with trilinear filtering.

Connect the normal map to the normal channel as an RGB image with trilinear filtering.

Connect the transparency map to the transparency channel as a luminance image with trilinear filtering. Set it to alpha blending otherwise it won’t look good. Set the transparency to a low value, like 10 to have some blending.

In order to compensate for the loss of hair visibility we will introduce some emission as well. Once again you can use a separate texture for it as well, but a solid color does just fine. As I said in the beginning here a lower emission value is enough, for me it was something like 20.

I have found that glossiness and spectacularity don’t make any real contribution to the look so I left those at 0.

Thank you for this quick breakdown, I can see this have a year since it was published and is the first time I see it. It is impressive to see the lack of information about a proper workflow when it comes to hair and fur for video games. Maybe one or two articles in a 3d magazine or a few post on polycount and Artsation, but nothing solid. Thank you!!