Creating Realistic Hair with Maya XGen

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Before we start, there are three main concepts or terms that we need to have a basic understanding of: Guides Grooming all the hair strands one by one is extremely time consuming and not ideal, that's why we use guides to direct and form groups of hairs instead of strands. based on how many guides you add, the effective area around each guide differs. Maps We use maps to visually define and limit magnitudes of some specific characteristics of hair throughout the surface. in some cases, expressions can be used instead of maps to create some unique patterns. Modifiers Some forms in different types of hair are so subtle and complex that making them manually can be really tedious, that's where modifiers such as clump, coil or noise come into play. Density map is a black and white texture of which black areas contain zero percent density and white areas hundred percent. In other words, you determine where exactly you want the hair strands to be planted on. First import your model to ZBrush, don't forget to turn on Perspective. Subdivide your model a few times so that you can paint your map in higher resolution. Change the material to SkinShade4. Switch to black in the color palette then in the Color menu click on Fill Object. In order to make it easier to see the model's surface, go to the Material menu and increase Colorize Ambient to max. To paint with the Standard brush, turn off Z-add on the top toolbar and turn on RGB, do the same with the Smooth brush while holding the Shift key. If you want to use a reference photo, Import your image from the Texture menu. After that, click on the texture and then turn on Add to Spotlight. The image will appear on the canvas. You can move it around and put it in position using the ring. After placing the reference, press Z on your keyboard to lock the spotlight. Now place the model on top of the image and start painting. Every time you want to paint white on your model you have to turn off the spotlight using the shortcut Shift+Z, otherwise it will project the image on your model. You can also paint your map in Maya but the reason why I paint my maps inside ZBrush is that it's more intuitive and easier to compare the result with the references. Maya is not a tool mainly designed for this purpose. Also with this method we only need to paint one map for all the hair descriptions which as you'll see in the next sections it's going to save us a lot of time. To export the map go to Z-plugin menu, activate Texture from Polypaint in Multi Map Exporter submenu then adjust your prefered resolution and finally hit Create All Maps. This is an optional step, but I always use the density map as color texture for my default material in Maya, since it helps me know exactly where to add the hair guides. Now that we have our model and map ready, it's time to add some hair. While having your model selected, grab the Paint Selection Tool, right click on your model and switch to Face mode. In the brush settings, turn on Reflection and start highlighting the polygons around the area that you've painted the eyebrows in your map. No need to be accurate here, since you can always change your polygon base later. You can either use a separate base or scalp to place your guides on or do it directly on the mesh. Using scalps could be really helpful if your model doesn't have a good topology or if your plan is to use it for animation later. But since I'm constantly tweaking and improving my model and adjusting scalps to those changes sometimes could become problematic, I find it more straightforward to just add the hair on top of my model. After you have your polygon selection ready, in the Xgen shelf menu, click on Create Xgen Description. There are a few things that need to be changed here: In the Description Name field, enter Eyebrows and for the Collection's name, just name it Hair or anything you want. In the last section, set "Control the Primitives by" to "Placing and shaping Guides". In order to prevent the model to get accidentally selected while working with the guides, you can add your model to a layer and set that layer to Reference mode. To place hair guides on the surface, select "Add or Move Guides" tool from the shelf and click on any point on the mesh to add your first guide. After adding the guides we need to reshape them using the Sculpt Guides tool. It's wise to have at least one reference photo on display while working to make sure you shape the guides to the right direction. One thing that could save you time and help you add the guides more efficiently, is to start by adding the first and the last guide and reshape them, then Xgen will interpolate the guides in between automatically, means that you don't have to shape them all one by one. When Xgen automatically interpolate guides, they're slightly shorter than the guides on both ends, that's why in the end I always select all my guides and reset their length to make sure that they're all in equal size. Then I adjust their sizes individually using the scale tool. Now that we have all our guides in place, it's time to adjust the hair thickness and density. For now crank up the density to 100 but it will change later. For the width or thickness, click on the Sigma sign at the end of the slider to enter a basic random expression. My values are usually between .006 and .008 but it depends on the scale of your model, meaning that the correct values might be different for you. Change the Modifier CV Count from 5 to 20. It's the number of segments that each hair strand is made of. Since naturally hair tip is a bit thinner than its root, I try to replicate that using the Width Ramp. It simply multiples your thickness value towards the hair length. It's time to use the density map that we painted in Zbrush. Click on the drop down menu next to the Mask field and hit Create Map. In the new box choose a name for your map, Enter 10 for the Map Resolution and click on Create. Maya automatically switches to 3D Paint tool, but since we have a map ready we don't need to paint anything here. Sometimes Maya might get buggy here, but there's an easy workaround to make sure that everything works as it should. You just need to set your project once more and right after click on the save button next to the mask field. Now if you open your Hypershade window, in the Textures tab you can see that there's a new file node created. This is where we have to assign the map that we painted in Zbrush. But first to keep things organized, I change the nodes' name to something that helps me find them easier later. Click on the folder icon next to the Image Name field and select your density map in the new window. If you keep all your texture files in your source images folder, Maya will update the links automatically if you copy your project folder to somewhere else on your computer. The final step to assign the density map is to hit the save button next to your mask field once more. If you decide to edit your map later in Zbrush, after replacing the new map in the folder, to apply those changes you need to save the mask again. This is completely optional but if you want the hair preview in the viewport look smoother, in the Hardware Renderer 2.0 settings, turn on Mutisampling Anti-Aliasing and increase the Sample count. You might wanna skip this step if you're low on resources. It seems that I need to increase the hair density a little bit. The reason why I only placed the guides on one half of the face, is that Xgen has a very handy tool called Mirror Guides that conveniently mirrors a copy of the selected guides to the other half of the model. But beware that you need to have a symmetrical topology to take advantage of this functionality. To have better control over the hair line, I usually use a second map for the thickness. This time it's better to paint the map inside Maya to see the results instantly. The steps are identical, create the map, enter the name and resolution and to make sure everything works properly, reset your project. After that click on the save icon. By using a thickness map, you reset the hair thickness to its maximum which is 1. To put a limit on that max thickness, we can easily multiply the variable by our desired thickness which if you remember was a random expression. So basically we multiply the variable a by that random expression. Now click on the brush icon again to enter painting mode. In the 3D Paint tool settings, click on Assign/Edit Texture. Change the size to 2048 and hit Assign. You can adjust the brush radius using the first slider, also lower the color opacity to about 60%. What I'm trying to do here is to lower the thickness of some of the stray hairs around the edges, this will help the hair line to look smoother and eventually more realistic in the final render. The final step is to add some modifiers to the hair. But let's pause for a second and see what each one of these modifiers does. There are only four types of modifiers that we're going to use. Clumping is probably the most important modifier, it basically attracts groups of hair strands towards the clumping guide positions. We use cut to give each hair strand a slightly different and unique length and make the hair look more natural. Coil modifier could be really useful for specific types of hair, but a small amount of coil could be also used as some type of noise. Noise modifier is pretty self-explanatory. It adds three-dimensional noise to each hair strand. In the Xgen window, switch to Modifiers tab and click on Add new Modifier icon. Clumping is the first modifier that we're going to add. After adding the modifier, click on Setup Maps, here we can adjust the clumping guides. Clumping guides are different than hair guides, they define on what points on the surface you want the clumping effect to happen. Here I just change the density to 60, hit generate then save. For the modifiers mask, I prefer to use an expression instead of a map. It's a very simple expression, you don't need to know how to code, just copy what you see. But if you're curious about what it does, it basically translates to a noise pattern throughout the surface. In other words instead of applying a constant value to all the hair strands, we have a random but at the same time controllable value. In addition to that, we can also use a basic random expression for the Clumping value. I decrease the root value of the clump scale so that the root of each clump looks tighter and more separate from its neighbors. The copy effect, sets the blending of the clumping effect between neighboring clumps. To better understand what each one of these effects does, I encourage you to try and change their values at least once and see the results for yourself. Copy, noise and curl are the only effects that I use for the clumping modifier, these are subtle effects that help to add that extra layer of realism to the hair. The second modifier we're gonna add is Cut, the settings are very simple. I use the same expression that I used for the clumping. Coil is the next modifier. The same expression but slightly less value. The radius here is like the magnitude for Coil, I keep the numbers very low for this modifier. Noise is the last modifier that we add. Again the same expression for the mask here as well. Try to keep this modifier subtle, we don't need to add too much noise to the eyebrows. The instructions for the rest of the descriptions is technically similar to what we did for the eyebrows. So I'll just explain those parts that might be different. I always add upper and lower eyelashes in two separate descriptions since they usually have slightly different density and thickness. For this subdivision I only select one polygon row for the base geometry, but if your polygon density is higher, you might need more than one row. Be careful not to add the eyelashes too high or too low, looking at some high quality references could help you understand where exactly you should add the lashes. Just like what we did in the previous section to do this more efficiently, we add and reshape the first and the last guide then the guides in between will be automatically interpolated. The values that we use for the modifiers are mostly the same or close to what we used in the previous part. To add another iteration of a modifier, right click on it and hit duplicate. Adding multiple iterations of the same type of modifier is pretty common, for example here I want to add a higher magnitude of noise to a lower percentage of the lashes. The same goes for clumping. Again I suggest you to try and understand the concept of each one these values instead of following my numbers, since the right values could be vastly different from case to case. If you remember, I said in the first section that we can use the same map for all the hair descriptions. To do this, first create a map for the density and just hit save, you don't need to paint anything. After that open the Hypershade, in the textures tab right click on the texture node that we used for the eyebrows and hit Graph Network. Now right click on the graph, hover on Show, and in Objects submenu, enable Geometry by checking the box next to it. A new node appears on the graph and you can see that the texture is connected to one of its inputs, that input is the Eyebrows density and below that you can find the input for the eyelashes. Now simply just connect the Alpha output of the texture to the Mask input. Finally you just need to click on the save button for the mask to apply the map. For the lower eyelashes, instead of making a new description from scratch, we can duplicate the description for the upper lashes, since the settings are mostly the same. On the left dropdown select the description for the eyelashes and on the right, enter the name for the new description, also make sure you uncheck Include Patch Bindings. This new description doesn't have any geometry bound to it, so we have to select and assign the base polygons. Unlike the upper eyelashes, this time I select two polygon rows for the base. You'll see why in a bit. After selecting the polygons, click on the dropdown next to this icon and hit Replace with Selected Faces, and now we can start adding new guides. Density and thickness for lower eyelashes are naturally less than upper eyelashes. Keep in mind that each time you duplicate a description, you have to regenerate the points of its clumping modifiers. We do the same steps that we did in the last section to assign the density map to the mask here as well. I usually use an additional map for lower eyelashes' thickness, it helps to make it look more scattered than just in a straight line, and that's also why I selected two polygon rows as its base geometry. Again we follow the same instruction here as well, select a base geometry, add the guides, maps, modifiers and so on... The hairstyle that I've chosen might be a little bit challenging, if it's your first try, you might wanna go for something simpler. Explaining the process for this part is difficult, it's one of those skills that comes with experience, you just have to do at least a couple of examples to finally learn and understand where to start or how many guides to add to replicate the hairstyle that you have in mind. To copy a guide's shape, right click on it and hit Copy Guide Shape, then right click on the next one and Paste Guide Shape. The modifiers are mostly the same, but the only difference is that for the first clumping, instead of generating based on a density, I click on Guide, which means that my clumping guides will be on the same spots as my hair guides. This really helps to have a better control over the hair. You can use a region map to override how the guides interpolate the placement and behavior of hair strands on the mesh, areas set by the map ensure that hair strands close to the hair part are only influenced by the guides in that region. In simple terms, hairs on each color will be completely isolated from the rest. Region mask controls the effect of the region map, I use a mask here because I want the region map to only influence a specific area of the hair. Transition hair is the transition between the hair grown on the head and the facial hair. It helps to have the hairline look smoother and more realistic in the render. For the transition hair, I duplicate the main hair description to be more efficient. Vellus hair also referred to as peach fuzz is a translucent layer of hair that grows on the face and is noticeably thinner than other hair on the body. This time I start with selecting all the polygons then deselecting those areas that are not visible. Thanks for watching. If you have any questions please drop a comment or send me an email. Until next time.
Info
Channel: Hadi Karimi
Views: 97,832
Rating: 4.9847603 out of 5
Keywords: Tutorial, Autodesk Maya, Hair Grooming, 3D Portrait, CG Face, Anne Hathaway
Id: RkpJ4LGJrf8
Channel Id: undefined
Length: 138min 24sec (8304 seconds)
Published: Mon Jan 04 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.