Unity3D Hair Rendering and simulating hairdressing and hairstyles
Simulating real-world hair colors and women’s hair coloring styles
Hair rendering in a 3D real-time environment is one of the most challenging tasks due to its immense complexity. Although extensive research has been conducted in this area, there is no universal method, shader, or general-purpose material for its implementation. Each project has unique requirements based on its hardware, software, and budget constraints.
For instance, hair rendering in computer games differs significantly, as hardware resources must also be allocated to other aspects of the game such as artificial intelligence, game logic, networking, and sound. In this particular project, I dedicated most of the available hardware resources to 3D rendering and graphic processing.
The initial project requirements were as follows:
- Render hair in a real-time environment as realistically as possible, given the available software and hardware capabilities.
- Create and simulate a hair coloring system that closely replicates real-world conditions, supporting a variety of amber hair color models.
- Automatically apply pre-made hairstyles to scanned 3D head models.
- Provide dedicated display support for VR headsets.
Each of these objectives presented significant challenges, for which I developed specific solutions and methods that I will discuss in detail below.

1-3D modeling Hair And Realtime Render
One of the greatest challenges for both myself and my 3D modeling team was creating hairstyle models that closely resembled the real hairstyles used in modern salons, while also ensuring they were displayed with the highest quality and reliability for the audience. Hardware considerations, such as graphics memory limitations and rendering efficiency, were also critical factors.
To address these challenges, we began by researching real-world hairstyles and categorizing them into specific groups. For each category, we established clear budgets for the 3D models in terms of the maximum number of triangles and shader pass limits. While managing the 3D modeling team,
I also conducted research and handled the necessary shader programming.
Beyond rendering hair and shadows, the custom shader needed to simulate a variety of hair colors found in salons. The system for combining and displaying ombre hair colors was developed based on real-world research and input from professional hairdressers.
2-Shader Development
I developed the primary hair rendering shader using Unity’s shader language. This shader is composed of multiple layers and sections to handle both rendering and color simulation.
It includes modules for light and shadow rendering, hair color processing, and the simulation of amber and mesh effects. To maximize control over the final appearance, I instructed the modeling team to create each 3D hair model with two or more layers of specific UV data.
Within each hair shader, I utilized these UV layers to manage different aspects of hair rendering. These included the main hair texture rendering (for hair strand transparency), the color rendering section, and dedicated areas for amber and mesh color effects.
3-PostProductions
One of the most demanding aspects in terms of processing load for transparent objects and overlapping layers is anti-aliasing. Rendering the transparent layers of hair without proper pixel anti-aliasing results in poor visual quality. In this project, I implemented both MSAA and TFAA simultaneously to address this issue. Additionally, I utilized screen space ambient occlusion (SSAO) due to its high speed and excellent quality for creating realistic contact shadows.
4-Align and fit Hair Models With any 3d Scanned head
One of the most difficult challenges I faced was fitting and positioning various 3D hairstyles onto a wide range of 3D scanned head models.
To solve this, I defined 32 key points for each hairstyle, which were used in conjunction with a skin mesh to control the shape and structure of the 3D hair model. The modeling team also placed 32 corresponding points on each head model.
By matching these hair points with the points on the head model, the hairstyles could be accurately fitted and positioned on different heads.
5-VR Presentaion

There were limited options when it came to choosing a VR headset model. Ultimately, I selected the HTC VIVE 2 over the Oculus Rift and other models, as it offered a higher resolution than its competitors, which was crucial for the project’s VR display requirements. Rendering hairstyles on a standard monitor was already a significant processing challenge. However, rendering for the HTC VIVE 2 VR headset was even more demanding, as it required nearly double the resolution and simultaneous rendering from two different perspectives—all while maintaining high visual quality. This nearly doubled the processing load. To prevent frame drops in VR mode, I made optimizations to both the shader and the 3D hair mesh. As a result, I was able to achieve a frame rate of 20 to 30 frames per second at a resolution of 3840×1080, meeting the quality and performance standards needed for the project.
6-Crowns and Dresses
One of the project’s requirements was to display various crowns for each hairstyle with realistic rendering, as well as to showcase different clothing options for each body style. To achieve this, I designated specific locations on each hairstyle for crown placement. This allowed users to easily select and insert different crowns for each hairstyle, positioning the hair naturally within the crown.For clothing, the 3D body models were created based on standard body categories, and garments were designed to fit these 3D body models accurately.