home ResumeDemoReelResearchSoftwareAnimationMusicPersonal  
Research Projects


HAIR Model Files


Mesh Colors



Dual Scattering Approximation



Wave Particles



Deep Opacity Maps



Hair Rendering with Global Illumination



Real-time Hair Simulation and Rendering



Practical Hair Modeling and Styling



Gradient Space Projection

straight.hair

File size: 1.68 MB
10,000 strands
160,000 points


natural.hair

File size: 16.0 MB
10,000 strands
1,519,823 points


blonde.hair

File size: 7.24 MB
10,000 strands
687,532 points


dark.hair

File size: 11.0 MB
15,000 strands
1,031,268 points



C++ Implementation

cyCodeBase has a code release, cyHair, which includes a C++ class implementation that loads and saves hair model files in HAIR file format. Please refer to Using HAIR Files for an example code using this code release.



HAIR File Format Specification

This is a binary file format for 3D hair models. The 3D hair model consists of strands, each one of which is represented by a number of line segments. A HAIR file begins with a 128-Byte long header followed by the following arrays (in presented order) that keep the geometry and topology data:

  • Segments array (unsigned short)
    This array keeps the number of segments of each hair strand. Each entry is a 16-bit unsigned integer, therefore each hair strand can have up to 65,536 segments.

  • Points array (float)
    This array keeps the 3D positions each of hair strand point. These points are not shared by different hair strands; each point belongs to a particular hair strand only. Line segments of a hair strand connects consecutive points. The points in this array are ordered by strand and from root to tip; such that it begins with the root point of the first hair strand, continues with the next point of the first hair strand until the tip of the first hair strand, and then comes the points of the next hair strands. Each entry is a 32-bit floating point number, and each point is defined by 3 consecutive numbers that correspond to x, y, and z coordinates.

  • Thickness array (float)
    This array keeps the thickness of hair strands at point locations, therefore the size of this array is equal to the number of points. Each entry is a 32-bit floating point number.

  • Transparency array (float)
    This array keeps the transparency of hair strands at point locations, therefore the size of this array is equal to the number of points. Each entry is a 32-bit floating point number.

  • Color array (float)
    This array keeps the color of hair strands at point locations, therefore the size of this array is three times the number of points. Each entry is a 32-bit floating point number, and each color is defined by 3 consecutive numbers that correspond to red, green, and blue components.

A HAIR file must have a points array, but all the other arrays are optional. When an array does not exist, corresponding default value from the file header is used instead of the missing array.


HAIR File Header (128 Bytes)

Bytes 0-3 Must be "HAIR" in ascii code (48 41 49 52)
Bytes 4-7 Number of hair strands as unsigned int
Bytes 8-11 Total number of points of all strands as unsigned int
Bytes 12-15 Bit array of data in the file
Bit-0 is 1 if the file has segments array.
Bit-1 is 1 if the file has points array (this bit must be 1).
Bit-2 is 1 if the file has thickness array.
Bit-3 is 1 if the file has transparency array.
Bit-4 is 1 if the file has color array.
Bit-5 to Bit-31 are reserved for future extension (must be 0).
Bytes 16-19 Default number of segments of hair strands as unsigned int
If the file does not have a segments array, this default value is used.
Bytes 20-23 Default thickness hair strands as float
If the file does not have a thickness array, this default value is used.
Bytes 24-27 Default transparency hair strands as float
If the file does not have a transparency array, this default value is used.
Bytes 28-39 Default color hair strands as float array of size 3
If the file does not have a thickness array, this default value is used.
Bytes 40-127 File information as char array of size 88 in ascii



buy cheap Earth 3D Space Tour screensaver 1.0
buy cheap WildPackets OmniPeek Enterprise with Enhanced Voice Option 5.0 Retail
buy cheap Digital Film Tools Power Mask 1.0 for Adobe Photoshop
buy cheap Ethersoft Easy MPEG AVI DIVX WMV RM to DVD 1.8
buy cheap Absolute Video to Audio Converter 2.9