By Audri Phillips
Download Get a Shave and a Haircut*: CG Hair and Fur [PDF 2.8MB]
Realistic hair and fur is one of the biggest challenges facing computer graphics artists and programmers. In the quest for photo-realistic and stylized hair, numerous methods have been tried-many of which are still used today. The 1995 film Jumanji often gets credit for being the first real example of photo-realistic hair and fur, but the story of computer generated (CG) hair and fur starts before that. Over the years, attempts to render these features have involved everything from brute-force painting and compositing to volumetric particle rendering systems.
The most popular method of growing hair today seems to be the use of curves with guide hairs. Guide curves (which are never rendered) are positioned as hair strands, and at the rendering stage, extra strands special primitives (which are neither polygon nor particle but limited to this specific use) are procedurally generated, using interpolation or a wisp-based model for their positioning. Most renderers, such as Pixar RenderMan* and Mental Ray*, have specialized hair/fur shaders that create these special primitives on the fly and give the hair/fur its material properties-color, shadows, tints, hue, highlights, kink, frizz, etc. One of the big problems these renderers have to deal with, of course, is jitter-especially the closer the camera is to the hair.
Later in this article I will delve into a wonderful tool called Shave and a Haircut* which currently is widely used to create realistic hair and fur.
First Animated Hair
When I first went to work at MetroLight Studios in 1993, I saw a short film called JuJu Shampoo, which had been made a year earlier. Not only was it funny, but I was really impressed with the long, flowing CG hair on the shrunken head (see Figure 1). This is when I first became interested in CG hair and fur.
Figure 1. A great example of CG hair from the film Juju Shampoo (stills courtesy of Steven Churchill, www.animationtrip.com)
The hair and fur program used in JuJu Shampoo and other MetroLight projects at that time was created by Rob Rosenblum. Rosenblum was doing something that was fairly obvious but hadn't been done by anyone before him: Not only did he place the hair interactively, but he was using a system of dynamics-a mass/spring/hinge system to move the hair. His system also dealt with self-shadowing of the hair: specular highlights would no longer appear everywhere, as they had in previous hair systems.
As Rosenblum remarked, "Geometrically, the hair was a polyline. Each hair was simulated as a chain of linear strand segments, where each segment was connected by a strong spring, with a hinge between each segment applying force to try to straighten the hair. The renderer could process the simulated 3D polylines, treating them as small cylinders without needing to convert them to a polygonal representation." His colors were based on calculating the light intensity on the hair by determining with a sample whether it was in shadow. Rosenblum is now at Disney Studios, running hair simulations on Rapunzel for Disney's next movie, Tangled.
Joe Alter and Hair
When I told people I was writing an article on hair and fur, I was steered in the direction of Shave and a Haircut, a tool used widely in the industry because of the good results it produces. It is available as a very reasonably priced plugin for Autodesk Maya*. Joe Alter, the creator of the program, worked at MetroLight Studios while Rosenblum was there. Alter was heavily influenced by Rosenblum's work, stating, "I credit Rob for his seminal paper that was written prior to our friendship/work relationship. Rob's ideas were more fully formed and realized at the time than mine. I found his paper instructive, and it helped me to solidify some of my own thinking when I wrote more prototypes at ILM." Alter went on to state, "The main 'aha' for Shave was the innovation that allowed the constraint-based dynamics to play nicely with the noise field-based displacements I had done prior. The only way to do it would be to make a solid 'hair coordinate system' that would move and flex with the hair guides: this is something that everyone does now in one way or another."
Trying Out Shave and a Haircut*
For my example, I start with the basic polygon head available from Autodesk Mudbox*, a modeling and 3D paint program that interfaces nicely with Maya. Figure 2 shows the head.
Figure 2. The generic head from Autodesk Mudbox*, with faces selected on the left and the head with a smooth applied to it on the right. I use a scalping technique to duplicate the scalp area before it's smoothed, and then grow the hair from it. I have also selected faces in a rough approximation of the scalp area out of which the hair will grow. I create a quick select set of the scalp faces so that I can choose them again after I do a general mesh smooth of the whole head.
Now, because I have created more polys, I can modify my face selection to more accurately reflect the scalp, then make a new, quick selection set from it. I choose the faces I want the hair to grow from, and then click Shave > Create New Hair. I selected the brunette option, but the different options all have default setting attached to them that provide excellent starting points for creating your hair.
Now that I have created the hair, I can start adjusting it. To do so, I click Shave Select > ShaveHairShape1, as Figure 3 shows.
Figure 3. Notice that the hairs seem to stand out perpendicular to the poly surfaces. The shave guide hairs are connected to the normals in the geometry. Like in many other hair setups, the guide hairs control the hairs around them.
Shave has a shelf, accessed from the Maya Shelf menu, that contains a brush tool (see Figure 4). Using this tool, you can actually comb the hair using any of five types of operations: translate, scale, rotate, stand hair on end, and clump. You can make these operations even more useful with the selection filters that Shave provides. These filters let you pick the guides, the individual vertices, and the tip or roots of the guides. You can also use the Maya selection tools to select vertices and individual guide hairs: The brush tool works only on what you select.
Figure 4. Shave tools in Maya
The cut tool is also extremely handy, as is the recomb hair tool. Unfortunately, Shave operations can't be undone using the Undo operation in Maya, but there is a Shave Undo for the last shave operation. This adds another reason for doing the good practice of saving often and versioning up. In general before I do any major change I always save.
Figure 5 shows the hair on my model before I style it.
Figure 5. Newly created hair before it's styled
I find that using relatively few tools-for now, the brush and filter tools-I'm able to create some rough starts for several hairstyles (see Figure 6). The brush scale tool is particularly good for giving different lengths to the hair. However, the geometry of the head doesn't stop the scaling, and the hair can continue to scale inside the head and on the other side of the head.
Figure 6. Hair styles roughed in using just the brush tool, the cut tool, and the selection filters/guides in Maya and Shave and a Haircut
Another feature I tried in Shave can really speed up the creation of a hairstyle. Instead of shaping the hair with the guide curves, which can be numerous and time-consuming to brush, I can create my hair object, and then create and draw in some nurbs curves to shape my hair style. Once I have drawn in the curves (with, say, the Maya pencil curve tool), I select the hair object with the new curves, and then click Shave > Edit Current > Comb Using Curves.
Rendering and Lighting
There are many things to consider when lighting hair. Hair is not completely opaque, and because light enters a strand of hair, it can produce two specular highlights, as it also reflects off the backside of a hair strand. Hair is not perfectly smooth, so the light reflects off a strand at different angles. Self-shadowing of the hair is important for eliminating unwanted highlights-a problem when hair that is supposed to be in shadow isn't. Hair rendering is always a challenge because of the complex way hair scatters light and the self-shadowing of hair. Light-colored hair is particularly dependent on the light scattering events that occur in a volume of hair. In addition, there is always a lot of variation inside the lighting. For greater control over the lighting of hair and fur, you might want to use a separate lighting rig as well as doing a separate render of the shadows on the head.
Shave and a Haircut addresses such lighting issues and provides a number of controls to work with. In lighting hair and fur, setting the specularity of the material is important, and Shave and a Haircut provides settings to do so. The material properties of the hair, such as root and tip color, specularity, and the amount of self-shadowing, along with other attributes can be adjusted in the attribute editor of the hair shape.
To select the lights that will create shadows on the hair or fur, I click Shave Globals > Buffer Mode > Cast Shadow Density, and clear all lights (see Figure 7). Otherwise, all of the lights in the scene will cast shadows on the hair and fur. To turn on the light shadows for only some lights on the hair and fur, Shave provides a light linking system. I select all of the lights I want to have throwing light at the hair or fur, and then click Shave > Shadow Attributes > Add. Then, I go into the attribute editor of any light I don't want to cast a shadow on the hair or fur and, under Shave Shadows, turn down the light resolution and fuzz to zero. The light will still cast light on the fur or hair, but it will not cast shadows or cause self-shadowing. A bit complicated, but it works.
Note: To render with Mental Ray, you need to go into the Shave globals and change the Hair Render Mode to Hair Primitives.
Figure 7. The image on the left shows the attribute editor for the hair shape. Note the wide range of attributes that you can change. The editor shows the default properties for the grass selection in Shave and a Haircut. The image on the right shows the attribute editor for a light. The red box shows the light settings for removing the shadow.
Besides the color and lighting of the hair, you have to consider is how to get natural movement into the hair. The hair must respond to the movement of the surface to which it is attached as well as external forces, such as gravity, wind, and interactions between the hairs themselves. Then, of course, there is the clumping of the hair, frizzing, kinking, and curling that are part of the look and movement.
Dynamics in Shave and a Haircut*
To use dynamics, you have to set up a directory for the state files dynamics will create. So, I click Shave > Shave Globals in the Shave Globals window that opens under the Dynamics section, then browse for a directory in which to save the files. Next, I click Shave > Dynamics > Run Dynamics current node or Run Dynamics All nodes. Figure 8 shows the effects of dynamics on the hair on my model.
Figure 8. You can use all of the dynamics fields available in Maya as well as Shave and a Haircut on the hair or fur. For example, you can select the hair and put an air field on it with a y direction, causing the hair to move upwards.
To make sure the hair does not penetrate through the geometry when it moves, I set up some collisions. For my head example, I select the hair system, and then click Shave > Edit Current > Update Collision Mesh. You can easily delete the dynamics files (Shave > Dynamics > Clear Dynamics Nodes) and run it again until the hair is as you like it (see Figure 9). You can also adjust parameter setting such as stiffness, root hold, and dampen in the Shave Hair Shape attribute editor as well as adjust gravity in the Shave Globals window.
Figure 9. Adjusting the dynamics for my hair model
Shave has many useful default settings. The image on the left in Figure 10 shows the default setting for grass lit with the default Maya lighting.
Figure 10. Hair and fur programs are often used to create vegetation. For example, DreamWorks Feature Animation uses the same proprietary program to create hair, fur, and grass. Their program is still based on the same PDI software that was used to make the first Shrek film.
Although there are special considerations to lighting fur and hair, the basic lighting principles and rigs used for all CGI can be used for hair and fur, as well. Figure 11 shows a simple lighting setup using a cluster of low-intensity directional lights to provide the ambient light and one low-angled directional light as the key light. Only the key light is creating the shadows and self-shadowing.
Figure 11. I created this simple image with Shave and a Haircut's default hair setting applied to a curved, bumpy plane. I threw a sky image on the camera plane and used the directional lights illustrated above to light the scene.
I had a bit of fun playing with Shave and a Haircut. With this tool, you can instance geometries to curves and model any polygon geometry, replacing the hair with it.
To do so, you first create new hair, then a polygon primitive, putting in height divisions. In my example, I select the hair, the polygon shape, and then click Shave > Edit Current > Instancing > Set Instance Object (see Figure 12). Note where your polygon object transform: This point influences where the instances are made. If you don't like where your instances have appeared, you can easily redo it. If you click Shave > Edit Current > Instancing > Clear Instance Object, you'll find that where the instanced form was, you're left with some hair geometries. Now, move your polygon shape to a centered position in relationship to your hair surface, select it and the original poly shape, and redo the instancing by clicking Shave > Edit Current > Instancing > Set Instance Object.
Figure 12. I'm having a bit of fun with Shave and a Haircut. Here's a frame from a work in progress with the working title Green Beans Gone Wild. I instanced the Shave hair with some geometry and played with animating the frizz and kink parameters as well as applying Maya fields to the forms.
New challenges always come up in computer graphics, but creating good hair and fur was certainly a big challenge to overcome, considering that it involves very complex organic forms to model, with special lighting and movement attributes to consider. I'm sure that more developments will come in the future. I greatly enjoyed using Shave and a Haircut and intend to go on using it and developing my skills. You should now have some basic information on the issues involved with creating good-looking hair and fur of your own.
- Rosenblum, R.E., E. Wayne, C. Tripp, and E. Tripp III. (1991) Simulating the structure and dynamics of human hair: modeling, rendering, and animation. Journal of Visualization and Computer Animation, 2(3):141-148. Available at /sites/default/files/m/1/7/7/hair-paper.pdf
- Rosenblum, R.E. A technique for rendering and animating human hair. Master's thesis, Ohio State University, June 1990.
- To see more a polished example of hair done with Shave and a Haircut, see the loop Joe Alter showed at his booth for SIGGRAPH 2010. Available at http://vimeo.com/13762453
About the Author
Audri Phillips is a Los Angeles–based artist currently working and exhibiting in a variety of media ranging from computer animation and motion graphics to her more personal work-oil paintings and video art (visual poetry). She has worked for more than 25 years as an artist/digital artist in the entertainment industry in Los Angeles at such studios as Disney Feature Animation, Sony Imageworks, DreamWorks Feature Animation, Rhythm and Hues, Digital Domain, and Electronic Arts as well as a number of small design boutiques. Her production experience includes art direction, design, visual development, storyboards, and color and lighting. Examples of her work are available at http://www.audri.com, http://www.alternatesight.com, http://visualmusic.ning.com/profile/AudriPhillips?xg_source=profiles_memberList, http://www.absolutearts.com, and http://www.lynda.com.