Website powered by

Real-time Hair Workflows

Article / 29 May 2020

--------------------------------------------------------

UPDATE:

Please check my newer version of the "Real-time Hair Workflows" article on my website Realtimehair.com

--------------------------------------------------------

For the last four months, I was making the real-time hair for an RPG, The Colony Ship by Iron Tower Studio. The hair meshes had to be really low poly (up to 4k tris), and I wanted them to still look realistic. During the first month, I had researched every (I believe) workflow is out there to make the real-time hair. Though there are a gazillion ways to do anything, making hair for games brings a few restrictions in choosing the workflow like the desired rendering quality, polygon budget and the restrictions/options of the shader in the game engine

I want to share my findings and the workflow I used in my particular case. Below you will find the list of the workflows with links on youtube and articles on how to make hair texture, place har cards, and make the hair cap.

The character hair for games is made with planes/ribbons with hair texture. There are a few steps of this process:

  1. Gathering references and planning
  2. Creating sculpted mesh for reference (optional)
  3. Creating hair texture maps
  4. Making the hair cap mesh and hair cap texture
  5. Placing the hair cards on the head model


1. References and Planning 

Creating hair for games involves a lot of steps, among which the most time consuming is placing the hair cards. In most cases, to achieve the best result, it is better to place hair cards manually. So it is crucial to plan the process ahead to save time.

Planning involves a profound understanding of the structure of the haircut you making. Gather references with the front, back, side, and top views of the hairstyle and answer these questions:

-       How the hair flows? In what direction?

-       What is the shape of hair parting?

-       What is the volume – the amount of hair?

-       Is it thick or thin?

-       Curly or straight? What is the level of dispersion? Are there a lot of messy strands?

Understanding every aspect of the hairstyle that you are creating allows you to choose the most effective workflow, save time, and achieve the best results.


2. Sculpted mesh for reference


To better answer the above questions, I started with the sculpted mesh in ZBrush. I would further use it as a 3d reference in Maya to place cards.

I didn't try to make the sculpt very detailed, kept it simple and low poly. The main goal is to design the hairstyle shape, establish the hair strands' flow, and estimate the width of the hair cards. 


3. Create the hair texture

Reference images helped me understand what kind of hair strands will fit this hairstyle best. Different game engines use different shaders (material properties) for the hair meshes. So it is necessary to check with technical artist/game programmer which texture maps required. Usually, they are:

ID, Depth, Normal, Alpha, Mask, Flow, Root (Gradient ramp), Color, Ambient occlusion. Some simpler shader uses only a few – Alpha, ID, Root, Normal.

There are different ways to create the hair texture, each method gives you different maps. But you can generate the Ambient occlusion from a Normal, for example, or ID map from Depth map using Photoshop or Substance Designer.


7 WAYS TO CREATE HAIR TEXTURES FOR REAL-TIME HAIR

When I was creating the hair strands, I followed these principles:

  • Hair strands variation – to avoid evident repetition in texture across the hair model.
  • Clumps with different hair amount - density. I tend to use cards with more dense texture as the base and place them closer to the hair scalp. On the top layer, I use the cards with lower density and some distinctive hair variations (like waves or gaps between strands). Here's a great breakdown of which strands to use on which level by Jansen Turk https://www.artstation.com/artwork/YaD6oP
  • Hair length variation – for strands with high density, I use the same length hair, for low-density hair, I create length variation and tapering towards tips.
  • It is better to keep each strand the same width – or have few types of width. Make hair cards which closer to the scalp wider, and others thinner – but the same width for each group (level). This will help switch UV space for hair cards (to use texture variation where it is necessary) and keep the rendered hair thickness the same for all cards.


A FEW WAYS TO CREATE THE HAIR CAP FOR REAL-TIME HAIR


5. Place hair cards

The lower your polygon budget, the more precise you should be about placing hair cards. I found that manual hair cards placing works best for me when trying to get the mesh done in 2-4k tris.


7 WAYS OF PLACING THE HAIR CARDS FOR REAL-TIME HAIR


I used the Quad Draw tool and placed the cards over live mesh (sculpted in ZBrush) in Maya to create the base form of the haircut and manually put the other layers of cards.

Before placing cards, I considered the following:

  • The lower polygon budget, the more precise you should be about putting hair cards. I found that manual hair cards placing works best for me when trying to get the mesh done in 2-4k tris.
  • How close the player will see the character's hair, from what angle (is it a top-down view, or a third person) To achieve the best result, make the hair look good from this particular angle/zoom. 
  • Setup the shader/hair material in the real-time engine and frequently check how the hair mesh with cards looks. I usually place first layer of cards and check the mesh in the engine. It allows me to spot the mistakes/see-throughs/gaps/texture repetitions and fix them before the card structure becomes complex.
  • If you are using cap mesh, it is good to plan a transition between cap texture and cards using cards with low-dense hair.
  • Be patient :)


Thanks for reading and let me know your thought in the comments.