In our previous blog post we gave a first glimpse into Frostbite research on hair rendering and simulation. In this post, we'll discuss the key differences between this technique and Frostbite's current solution for hair. In future posts, we'll focus on simulation and rendering aspects in greater detail.
For real-time scenes, the current standard in the game industry is to use so-called hair cards to represent a head of hair. A common workflow for content creators is to generate hair strands in a digital content creation tool, and then model a number of meshes, the hair cards, to represent the strands. The hair cards will then be textured by projecting the strands onto them.
You can see an example of this in the next image. The right hand side picture shows the meshes onto which the strands have been projected. On the left hand side picture, it’s relatively easy to notice that strands have been grouped together on the surface of a card by the projection. (Image courtesy of Criterion).
The higher the number of meshes, the better the illusion of simulating and rendering a real head of hair will be, but the more expensive the asset will be. Using hair cards is relatively cheap computationally, but reaching high quality in either rendering or simulation is difficult and can be extremely time consuming for the content creators.
Strand based hair takes advantage of a representation that has primarily been used in offline rendering. This means that both simulation and rendering are done at the individual hair-strand level. In the videos displayed in the previous blog post, about 10,000 strands were simulated and rendered. In real life, a full head of hair usually has more, but we found that for this specific asset this approximation was good enough. Whilst getting this high quality solution to be sufficiently fast for games is challenging, content creators find that authoring strand hair assets is easier and much faster than authoring hair cards as several steps described above for hair cards can be skipped.
This next image shows different hair styles exports using strands. Note that this image has not been rendered in-game. (Image courtesy of Criterion).
In terms of data, strands are imported into our engine as NURBS. Our data pipeline creates a set of points uniformly positioned along each strand to represent the curve (a process called tessellation). A high number of points along the curve will increase the quality of the simulation, but costs will rise. The tessellation is configurable per asset, and in the long hair asset we showed in our previous blog post, most strands feature 25 points per strand.
To illustrate this, here are two pictures of the asset, the one below shows the debug rendering mode on some of the strands to indicate where the simulated points are. The first two points in each strand are displayed in red, the other ones in green. In this asset we simulate every strand of hair, but in the picture below we use the debug rendering only on a small number of strands for readability.
In the following pictures, we fitted the mannequin* with a shorter hair style which only needs a very limited number of points per strand (from 3 to 5).
We hope that enabling the use of strands in real-time to represent hair, and overcoming the related technical challenges, will increase the overall visual quality of our characters, open up the possibility of creating some hair styles which were very difficult to realise with hair cards, and improve the workflows of our content creators.
* in our videos we use a mannequin instead of a human character to focus the attention on the hair rather than the skin, clothing or eyes.
Post Authors: Jon Valdes, Robin Taillandier
Contributors to Frostbite Strand Hair Technology: Pedram Karimfazli (Criterion), Jeremy O'Brien (Frostbite Physics), Simon Gomer (Frostbite Physics), Robin Taillandier (Frostbite Physics), Leo Taslaman (Frostbite Physics), Jaco van Dyk (Frostbite Physics), Yasin Uludag (Frostbite Rendering), Jon Valdes (Frostbite Rendering), Sebastian Tafuri (Frostbite Rendering)