A couple of years back, I was fiddling with Nvidia's Hairworks toolset to see if I can create realistic hair inside UE4. At the time it is a hobby project, I was aiming for a small tech demo showcasing realistic hair with character animations and physics. Little did I know, years later, the project became one of the reasons that drive me to make the game 《Drifting》.
At the time, I was following the tutorial posted on Nvidia's official website, which is a good way to start off creating hair strands in third-party software, however, along the way I developed a few tips and tricks that help me to get things done quickly and efficiently.
Using 3dsMax hair and fur modifier to create hair guides, I found out it is much easier to work with multiple modifiers instead of one modifier. By creating multiple modifiers, I can enable/disable each hairpiece individually which makes the "grooming" process (brushing, cutting, scaling hair guides) much more efficient. Additionally, after importing to UE4, each modifier represents a single hair component, which allows me to make minor adjustments to each hairpiece should I felt the need to do so.
(The colored lines on the left side represent a single hair and fur modifier in 3dsMax, the yellow outlined hair on the right side is the corresponding hair component in UE4. Noticed the tip of the backside hair has a reddish color and is much lighter than the rest of the hairpieces.)
After importing .apx files to UE4, the process of adjusting hair offline / run-time becomes much faster and simple since all of the parameters are controllable through Blueprint system. That being said, the method I found easiest to work with inside UE4, is to create a custom actor component storing all the Hairworks component parameters on "begin play event", this custom component is then used to manipulate all the Hairworks parameters at run-time.
The benefit of using this method is to prevent game logic from accessing Hairworks parameters directly which simplifies the manipulation of hair for other gameplay systems; additionally, the initialized parameters stored inside it can serve as a baseline for run-time hair manipulation.
Below are just a few examples of run-time hair manipulation.
(Baseline parameters without any run-time modification.)
(Stronger local wind and lighter hair mass. Notice each hairpiece respond to wind differently,
the backside hair has the strongest wind response.)
(Brighter hair color for root and tip.)
Last but not least, here is the tech demo I made a few years back, showcasing realistic hair with character animations and physics.
(Noticed at 1:54 the collision response between hair and shoulder bone. The collision cylinder is
pre-assigned in 3dsMax, Nvidia's Hairworks solution does not provide world collision in UE4.)
I hope you enjoy my article and found it interesting to read.
As a friendly reminder, since I am currently moving to a new apartment, I will not have internet access for a couple of days next week, hence, the updated content during 08/03~08/04 is canceled.
Have a wonderful weekend! ヽ(‘ ∇‘ )ノ