O'Reilly logo

Character Animation with Direct3D® by Carl Granberg

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The HairPatch Class

The naïve way of implementing the hair strips would be to have a single mesh for each of the hair strips and perhaps use some form of skinning to implement an animated hair strip. However, this is very inefficient! You’re bound to have hundreds of hair strips per haircut, so to improve performance you need to bundle strips together in one mesh to reduce the number of draw calls necessary to render the hair. So for this purpose I’ve created the HairPatch class, which implements a patch of hair defined as the area between four control hairs. Each of the four control hairs marks one corner of the “squarish” area of the hair patch. Figure 15.6 shows how the hair patch will be built.

Figure 15.6. The hair patch.

Note that all ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required