Second Attempt At Video Game Hair (better)

For my second attempt I combined the workflows from this Youtube channel (search for “hair cards”) and this Youtube video.

First I created 3 types of hair cards each for differing lengths of hair. The hair cards were curved to match the roundness of the head and the central edge was raised slightly to presumably create a better shading result later on. The UV islands were 1/8 the width the UV space.

An overview of the 3 types of hair cards I created in Blender

I then selected an area of the head where hair would go, duplicated the faces and made it into a separate object.

I created additional bending/curved hair cards from the first longest hair card. They all kept the same rectangular UV layout though.

6 Hair card types

I began to place “DuplicateLinked” copies of HairCardE at the back starting at the bottom and working upwards . While placing the cards I had snapping to face enabled, with the target set to Center and the Align Rotation to Target ticked. I chose to DuplicateLinked copies of it so that I could adjust the meshes later on more quickly if required. While placing them there is no need to avoid intersecting them with existing hair cards if you are going to use the Unreal Engine Hair Shading model as I did.
I added lots of long hair cards all over resulting in a mesh of 11000 vertices. Even though this image is on this page above the images showing how I created the material in Substance Designer, in reality this is the final version of the hair mesh. An earlier version of the hair mesh was tested with the textures from the Substance material below, in UE4, and then discovered that it needed more hair cards as there were many gaps that exposed the scalp, so I added a lot more hair cards until it arrived at what you see here above.
The meshes were using vertical rectangular UV islands.
With some UV islands shifted right a bit which is where I will generate different hair textures with Substance Designer
In Substance Designer I created a material for a single clump of hair consisting of 9 Scratches Generator nodes that each generated about 22 hairs and were warped and stretched and levelled and height blended to create the required outputs. You can download this material on Substance Share.
A close up of one of the Scratches Generator and neighbouring nodes
The height blend was used to combine the hairs together into a single clump and from there 4 of the outputs were generated.
The Unique Values output is a texture that is designed to be used by UE4’s Hair Shading model and consists of groups of hairs given one shade of grey from top to bottom overlaid with other groups of hairs that each have their own unique shade of grey (each group having the same shade of grey). To create the require shades of grey I used the Levels node then blended them together using a Blend node set to “Copy” mode. Its mask was specified by another Levels node that created a pure white and black mask.
The Root output was similar to the Unique Values output but multiplied with a Linear Gradient to make it dark at the top and white at the bottom of the texture
The Hair Clump Generator material was then used/instanced 12 times in a new material called Hair Generator that combined them and moved them to a certain area of the UV space. A Root and Alpha output was created specifically for the UE4 Hair Shading model. Its source node is an RGBA Merge node which places the Root texture onto the Red channel and the Opacity texture onto the Alpha channel of this particular texture.
In UE4 I then migrated the hair material from the Character Rendering level of the Content Examples free asset package to my UE4 project and created a new material instance. I then imported my hair mesh and the textures from the Designer substance material and assigned two of them to the material instance, the Root_And_Alpha texture and the Unique_Values texture.
The result in UE4 using the Hair shading model with the textures from the Substance Designer material
Increasing the Scatter value brightens the hair according to the RootColor and TipColor values of the material instance
Changing the TipColor value changes most of the hair color. It blends nicely with the RootColor.

Leave a Reply

Your email address will not be published. Required fields are marked *