Designing Dynamic Hair to not Intersect with Objects

I have recently figured out some key secrets to success in creating dynamic hair in Carrara.  Some of these principles may apply to other programs as well.  In this article, I will share two secrets for designing dynamic hair that will collide properly with objects during a simulation or draping, thus avoiding the problem of hair going right through objects.

One problem that you have doubtlessly run into working with dynamic hair is your hair going straight through a character’s ear or shoulder upon rendering.  Of course this can happen when your guide hair goes through the object in question.  In that case you just need to make sure your guide hair does not do this, but this is not the problem I am talking about.  I am talking about when you drape your characters hair, all of the guide hairs lay in the appropriate places, and you think everything is going just fine, but then, when you render, there is hair going right through the character anyway.  What is going wrong?

Well, the answer lies in how the guide hairs work.  The hair is filled in between/around the guide hairs via interpolation.  The guide hairs are the only thing that detects collisions with other objects.  If you place an object between two guide hairs then the hair will just go right through the object.  This often is a problem if you have hair falling on both sides of an ear or both the front and back of a shoulder.  A similar problem results when there is space between the edge of a growth region and the nearest guide hair.  In this case, the hair growing in that space between the guide hair and the edge of the growth region will wind up going through any object that gets in its way.  This problem shows itself when you attempt to drape hair along a character’s back and shoulders.  These two similar problems have their solution in two different principles of dynamic hair design.

The second problem can be solved by knowing where to place your guide hairs.  When you are creating dynamic hair, you might be tempted to just let Carrara fill in guide hairs at random, but if this is long hair, rather than fur, this is not a good idea.  It is significant where you put those guides.  You must have guides all along the edge of your growth region.  If there is not a guide at the edge of the growth region, then there is nothing for an object to collide with when it approaches the hair or vice versa.  The result is what I described before:  hair going through the character’s back and shoulders.  Even though the guide has draped across the shoulder, the generated hairs just fill in that space between the guide and the edge of the growth region.  If you place your guides all along the edges, then this will not happen.  There are reasons for filling in guide hairs throughout the middle of the hair as well, but that is beyond the scope of the problem I am discussing now.

The first problem I described is more complicated than just knowing where to place your guide hairs.  No matter where your guide hairs are, it is still possible for an object to be between them.  If this is the case, again, we have generated hairs moving through the object because the hair is being generated to fill the gap between these guides.  What we need is a way to tell the hair to fill the gap between some guide hairs and not others.  The way Carrara allows us to do this is via “grouping.”  there are two kinds of grouping in Carrara:  manual and auto-grouping.

Manual grouping means that you define independent growth regions, called “hair groups,” as part of the same hair object.  The effect of doing this is that the hair in each group fills in the hair only between its own guides, not considering those of other groups.  Consider the case of a character with long hair that falls both in front and in back of the shoulder.  If all of this hair was defined as a single group, then the generated hairs would go right through the shoulder.  If, however, you define the growth region for the hair that falls in front of the shoulder as one group and the growth region for the hair that falls in back as another, then you no longer have this problem.

Auto-grouping means letting Carrara decide how to group the hair when it is generating it.  In the properties for the hair, you can enable auto-grouping and set the conditions by which Carrara decides how to group hair.  I find that the most important condition is angle.  Using the angle condition means that if two neighboring guide hairs are pointing in significantly different directions, then there will not be hair generated between them, just as if they were in different groups.  This allows you to part hair.  You can use this for parting bangs or separating the hair on two sides of an ear or shoulder.  The value of the angle condition determines how different the angle must be.  Smaller values mean that the angles must match more closely.  The great thing about auto-grouping is that it is dynamic.  Unlike statically defined groups, when the hair comes together and you want it to act as a single group, it does.

By placing guide hairs all along the edges of your growth regions and using grouping appropriately, you can avoid these mysterious and annoying problems in your dynamic hair.  Each situation may call for a different guide configuration, depending on how objects in the scene might be interacting with the hair, but these are important principles to start with.  With this knowledge, hopefully, you can design hair that will work in a wide range of situations.