Tuesday, 28 February 2012

Creating the Hair ... the final attempt?

 Hair - Method 2

After doing some further research on hair and a few trial and error tests I now had to re-create the hair but keeping the dynamics in mind. (Hoping I will stick to this method and not change it again)

Just like before I created the unwrapped scalp separately. Selected the scalp > Hair > Create Hair (U and V's set to 20, no randomization and using Paint FX)
I increased the hair clumping and the amount of hairs to get a more dense hair system.

The next step is very important for getting the dynamics correct. I shortened the length of the hair by using the Scale Hair Tool (This can also be done by painting 'Extend Hairs')

Before explaining what I did I think I should briefly explain the Start, Current and Rest Position.

Start Position: Position of the hair at the start frame of the simulation. The Start curves stick straight out when the hair is first created.

Rest Position: This is the position of the hair when no forces at acting upon it (Such as gravity) Setting the Rest position correctly can effect the shape of the hair and more importantly can act as a hairspray feature. For example if I create a fringe that falls to the left hand side, I can move the hair around, reacting with wind and gravity, and when the hair stops it will try to retain that original shape.

Current position: These are the output and/or Paint Effects curves generated by the hair system.This is how the hair behaves when you play the simulation, which includes built-in dynamics. Do not edit the Current Position; just view it.

So to set the rest position I styled the hair by selecting half of the curves and adding a Uniform Field. This is one way of moving the curves by the specific point you have selected (make sure to use a falloff in your selection) I then set the current and rest position from here.

Finally a few tweaks to the curves to get the hair flowing better. 
(This is something that might need further work. It's a long and tedious process.)

I will just show you what minor tweaks I did to the attributes to create the final hair.

 Left: Used a multistreak of 1 to create more dense hair without the increase of render time.

Right: Larger Multistreak spread

  Left:  Smaller multistreak spread.

Right: Thinner hair. 

  Left: More curl (more curl the less reaction to wind = easier for me to do)

Right: Production quality

  Left: Depth map shadows (Default)

Right: Depth map shadows (1024 size) Better result but still not great. Long in rendering time.
  Left: Raytraced shadows. Much nicer result.

Right: Raytraced with 'Light each hair' enabled. Didn't seem to change anything.

Finally to get the hair colliding with the head I had to create a sphere constraint (Trying to use a collision mesh with a polygon object doesn't seem to work) Before selecting the Collide Sphere I had to have the Hair Follicles selected. I created two, one for the head and one for the back of the neck. These are constrained to the hair system, which follows the scalp which is then constrained to the head mesh and then hidden.

The final outcome isn't perfect but I am happy with how far I have got. I intend to take this further by altering the positions of the follicles ... at the moment they seem to be too perfectly positioned around the head. I will also try to get the hair to either cast more shadows or just make it more dense (To get rid of the visible scalp) The main issue I am having with it at the moment is trying to export the whole system to another file.

Creating Hair from curves in Maya

So my Fur didn't work out so great. I now tried out Maya's Hair feature. I started the same way by creating a new set of polys to act as the scalp.

There are two ways to make hair (at this point in time I only knew about one way, and as I find out later it's not the best way to do this if you want to make it dynamic but great if you want just a still shot) So I started by making a lod of curves that follow the head shape. To do this I just draw along the scalp with the CV Curve Tool. I then added a few random curves in between. 

 Once that is done I went to dynamics > Hair > Assign Hair System > New Hair System.

 I then went and selected the scalp and Hair > Create Hair and then placed the hairs to the new hair system that I just made. Usually you would just create hairs and go from there but because I created teh curves first and wanted the hair to follow those curves I had to first assign a hair system to the curves. 

You will then get something that looks like this. This is where I spent most of my time wondering why there is two types of hair systems here. If you look at my Outliner Maya has created a bunch of hairs following the curves I made but it has also created an entirely new set of follicles pointing out around the head. To get rid of these I had to delete the HairSystem2Follicles and leave the HairSystem2OutputCurves

This is the result with some minor tweaks to the attributes. Not that impressive but hey, I can finally say I have created hair!!

 To make the hair look more realistic I had to tweak the curves I originally made. I deleted a few of the random ones that start half way down the hair, this made it look very patchy in places. I then edited the directions of the curves by going into Componant Mode and soft selecting the points and using the translate, rotate and scale tools to alter them.

 Now I have a much more realistic look that acts similair to real hair. It follows the ear around to the back of the head and has a nice side fringe at the front.

 The only problem I had here is again I couldn't seem to get it to react to wind or even collide with the head. I also thought that the hair is looking quite long and quite soft so it would need some very accurate dynamics if I wanted to make it look realistic. If I could make the hair slightly shorter, more clumpier and a bit curlier then the hair wouldn't react to wind as much. Time to start this again from scratch ....

Why NOT to use Fur for a realistic head of hair

 Hey guys here is a post about how I used Maya's Fur to make the hair and I'll explain why it isn't a great idea if you want to make the hair look realistic. Especially if you want to make the hair medium to long length.

Thinking Fur was an easy way of making hair, I first duplicated the faces of the head to make the scalp (the reason I did this was because I couldnt find a way to apply the hair just to his head, instead it was covering his whole face making him look like Big Foot)

I applied a simple Fur preset and this is what I got. Only half of the head is shwoing hair in the viewport now and I have got some crazy bald hairline going through the middle of the head. After days of trying to figure this out I realised that the head wasn't unwrapped! If you want Fur or Hair to work your surface MUST BE UNWRAPPED IN 0 TO 1 SPACE!!!

 Because of the silly mop head look I got, I played around with the settings. I made the hair shorter, changed the Polar and inclination to force the hair downwards and got this result. 

 To try and avoid the horribly perfect hair line in the image above I further experimented with the Polar and Inclination so it's coming forward slightly and I also made it a lot thicker. You might be thinking the result I got below looks half decent but infact, if I rendered this it wouldn't look right. The reason being because I couldn't get it to move with the head and also because I didn't know how to get it to react with forces and collide with the head.

After reasearchign the advantages and disadvantages of using both Hair and Fur I decided to scrap this method and start from scratch with Hair. I found Hair gives you a lot more control on the style and how it reacts to wind.