Hello everyone! In this tutorial, I want to talk about my workflow – about how to create “real-time hair”, which we will render in the “Marmoset Toolbag” and “Unreal Engine 4”. Also, I will talk about how I created this hairstyle. Let’s talk about the all stages of creation and important points that are worth considering. We’ll also talk about how to bake the all necessary maps that are will be useful for you in any task. So, first of all, I bake – the so-called “Hair Cap”. A layer that is the first and always under the rest. Thanks to this layer – Hair Render looks much better. And you don’t have to spend a lot of time – for creating a large number of hair-planes to close the all gaps. This layer is created for a smooth transition from the roots to the geometry of the head. That is, hair growth looks much more natural and there are no bald patches, as is usually the case – without creating this layer. Also, thanks to this layer, a volume effect is created on short hair. If you bake them immediately on the main Mesh, then this effect will not be seen. Most studios use this workflow – when creating a separate layer for the base texture of eyebrows and short hair. Also, for this “hair mesh” a light “Push” is made, so that it push away slightly behind the main geometry of the head and a volume effect is created. Right now I will tell you how to bake a texture on such a mesh and get the first layer with short hair and eyebrows. The first thing you need to do is “Detach” the scalp and eyebrow areas on a copy of the original mesh. Usually, clients give me already optimized heads, so I don’t waste time for optimizing them. “Mesh Detach” and the whole workflow – I will show in Maya. since it’s much more comfortable for me to work in it and the baking tools are better implemented here. Yes, and I already spoke in previous videos about why I switched to Maya, although I also work with orders in 3ds Max. By the way, I haven’t forgotten about the next part of “BraidWorkflow”. Just because the virus recently ate all the recorded materials – I will need to record everything again from scratch. But, since many people asked, first of all, for the release of this video – I release it. And then I will proceed to continue recroding of the “Braid Workflow” series. So, to separate the scalp from the head – just select it, then this tool, in “Stroke” turn on the symmetry and select the area that you want to separate. Then make a duplicate – for this press Ctrl + D, after which – a combination of CTRL + SHIFT + I and after – DELETE. Thus – you will receive a separate Mesh for further work. I just now quickly showed how you can perform this operation. Naturally, you should more accurately select and get a full scalp geometry. After you have the separated scalp, you just need to select it and apply the “FurBall” preset in “Ornatrix.” Then go to the “GuideFromMesh” modifier and reduce the length of the guides by using the “Length” parameter in the “Guides.” Then – change the curve in the “Width Ramp”. Make it look like this and also decrease the value of the “Width” parameter. By the way, this is not the final value. I just use it at the beginning for comfortable work in “Viewport”. Further, above the “Edit Guides” modifier I use “SurfaceComb” – in order to indicate the direction of the hair by using a special sinks guides. In order to activate these guides – click on the “Sinks Editing Tool” button. By the way, I don’t recommend to turning on the symmetry, since without it, the result looks much more realistic. Begin the creation of “Sinks” from this point, since if you focus on references, hair grows in that direction from it. Don’t worry about the ideal direction, because then, if desired, you can fix everything in the next “Edit Guides” modifier. After you have created the all sinks guides – press “Q” to turn off the “Sinks Editing Tool”. After the operations done, – “HairFromGuides” can be temporarily turned off and you can look at the result with guides. Then turn it back on and select “Barycentric interpolation” in the “Guide Selection”. And in the “Triangulation Type” – “Manual Triangulation”. This is a new interpolation method that has appeared recently. And in most situations it gives the best result. After creating the hair – you need to draw a mask in “HairFromGuides” and make changes to the settings, as well as possibly add guides – for better interpolation. Usually, after I set the hair direction in “Surface Comb” – I create another “Edit Guides” on top of this modifier. And I collapse the list of modifiers to HairFromGuides – in order to apply the all settings for the guides. To do this, select the latest modifier in front of “HairFromGuides”, press the right mouse button and select “Collapse Up To Here”. As a result, you will have the “BakedGuides” modifier and there will be no problems in the future. Then, I create a more realistic hair contour with a drawn mask in HairFromGuides. You can draw it in “Maya” by using the “3D Paint Tool” or “Mudbox”. Here you already choose what is more convenient for you to use. I draw the mask In “Mudbox” if there are a lot of “UV-patches” in the model and the mesh has UV-seams. Since, in this case, the standard “3D Paint Tool” does not know how to blur the contour at the seams and it turns out an unpleasant bug. That is, you just can’t make a smooth gradient. Since at the moment I have one “UV patch” for the entire scalp, then I can draw a mask inside “Maya” and there will be no problems. So, to start drawing a mask for “HairFromGuides”, you need to select an object with hair, select this modifier and turn it off. That there were no lags in “Viewport” during drawing. After that – you need to click on this icon. In order for everything to work correctly, you also need to assign the Lambert1 material to the scalp. Otherwise, the 3D Paint Tool will not work. When everything is ready, you need to click on this icon, enter the name of the mask, select the save format – I usually choose JPEG. Then you need to specify the save path, its size, base color and “UVSet”. After that – click on the “Create” button. Immediately after this action – you will activate the “3D Paint Tool”. In “Tool Settings” you can configure this tool. For example, change the color or adjust the strenght of blur – while drawing while holding down the “Shift” key. If you don’t know how to open the “Tool Settings”, now I’ll tell you how to do it. Go into the “Windows – General Editors -Tool Settings” and drag this window to the place of the Maya interface in which it will be convenient for you to work with this panel. So, to paint with the color that you selected in the “Color” tab – you need to activate the “Paint” tool for the “Artisan” option. If you draw with the Shift key pressed, the Blur tool is activated. Which allows you to blur the border or edge of the color. To adjust the blur intensity, select this tool and change the “Blur Intensity” parameter. Thanks to this tool – you can create a smooth color gradient and due to this – there will be a smooth transition from hair to skin. As a result, your task is to draw a smooth contour along the contour of the scalp. On the back of the head draw in approximately this way – focusing on photo references. I won’t waste time drawing a mask now and will immediately show you what should be in result. By the way, to enable symmetry while drawing – you need to go down below, go to “Stroke” and enable the “Reflection” option. After that – you must choose the axis along which the miscalculation of symmetry will go. Then draw a mask in this mode and as a result – you should get such a result. Then, when you apply this mask – you get such a hairstyle. After that, the all hair that gets out beyond the scalp contour will need to be removed with the help of additional modifiers. And also, fix some hairs that fit into the scalp geometry by using “Push Away From Surface”. That is, in the final – you should have a list of such modifiers. After “HairFromGuides” you need to assign a “Length” modifier and apply such settings. Just this particular modifier removes the hairs that climb out beyond the contour and give a variety in the length of the all hair – using the “Randomize” parameter. After the “Length” modifier – I assign “Frizz”. In order to bring a little chaos into the shape of the hair. The final value for “Change Width” is 0.005. But for now, I will return the previous one so that you can see the difference in working with “PushAway” and without it. Just the last modifier I assign so that the hairs doesn’t intersect with the geometry. Otherwise, hair baking occurs with gaps in the texture. So, the base layer with hair is ready for baking. Now I will tell you how to do it and what textures I usually bake. So, to bake hair on your scalp – first you need to decide what kind of render do you want to use for baking. In my workflow I will use “V-Ray” and “Arnold”. Because V-Ray cannot bake some cards. What kind? You will soon find out. Maybe I just haven’t found a solution yet and one of you will suggest it in a comment. Please write about it after watching this video series if you know another method. In the meantime, I am sharing what I know. So, the first step that you must take is to go into the settings and activate the “V-Ray Render”. In the “Production Engine” – you need to select “CPU”, since baking for this “workflow” does not work on the “GPU” yet. After this step, you need to create an “HDRi Dome” with these settings. Then select the scalp and click on this icon in the “V-Ray” tab. Thus – you will create “V-Ray Bake Options”, in which you can make all the settings “baking”. Usually, I leave them – by default and only change the resolution. For example, most often I put – “4K”. At the moment, for the lesson – I will indicate a lower value, so that the render goes faster and you see the result. Then select the hair and assign the usual “V-Ray Hair Mtl 3”, and not “V-Ray Hair Next”. This material is better than new – specifically for baking hair. Its settings are very simple and first of all, I use this material – for baking the “Albedo map”. So, to the slots “Overal Color”, “Diffuse color” and “Primary Specular” I connect the “Ramp” map. In order to add this node – press “Tab” and write “Ramp”. After that – select “ramp (texture)”. Then, immediately remove “place2DTexture”, because – we do not need this node. And in “UV Coord”, namely in the slot “V Coord” – you need to connect another node called “VRayHairSampler”. Depending on the task, connect one of the available slots to the “V Coord” slot in the “Ramp” node. Usually, the first slot I use is “Random by Strand”. I do this in order to add some variety to the color of my hair. When you have a heterogeneous color – the result is better – based on my observations. In the “Ramp Attributes” settings, in the “Type” select “V Ramp” and make a gradient of this type. With the help of “Presets”, you can save different color variations for the hair. For an example – I will choose such a gradient. So. the material is ready. Now you can start baking it. To do this, select the scalp and again open the “V-Ray” tab on the “Maya shelf”. After that, right-click on the icon that is already familiar to you and select the “Bake with V-Ray” option. By the way, you can render both the “Bucket” and the “Progressive” method. The choice of method depends on the quality you need. I prefer the “Bucket” method with the settings that I will show now after the render is over. These settings are enough for me for the quality that I have in Marmoset or Unreal Engine 4. Yes, and my customers are satisfied with this quality. So, you have “Albedo” and “Alpha” cards. If you try to bake a normal map, then you will not succeed. Instead, it will be Object Space, but it can come in handy in Unity. By the way, to add a normal map renderer – in the rendering settings, go to the “Render Elements” tab. In this tab, make the preset “vrayRE_normals” active. And, as promised, I show my settings, which I use for baking textures in V-Ray. This is enough for the quality that you can see in my portfolio. If you are not satisfied with the rendering time of the “Bucket” method, then select “Progressive” and set the time that you need. But please note that the quality will be a little worse. So, after “Albedo”, “Alpha” and “Object Space” are baked, I proceed to bake the “ID” and “Root” maps for “Unreal Engine 4”. This is exactly what V-Ray Hair Sampler will help you with. But about this – we will talk in the next part. Thank you for watching and I wish you a good mood. Peace for everyone!