Toon Shader Tutorial - Part 4 - How to Make Anisotropic Hair (Blender 2.8/EEVEE)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys I'm David from lying about studio and in this episode we'll show you how to make a stylized and his Oh tropic hair shader I will explain step-by-step everything you need to know to start building the shader Network how to tweak the settings to really find the style it suits you and will even show you how to apply the shader to an actual character so we can see exactly how to unwrap hair geometry and even how to apply some extra texture details on top so this tutorial will be a bit longer than usual but as always hopefully a lot of fun so grab a seat and let's get started alright so we have our good old fear here and the team shader that we've built over the last few tutorials and if any of you wants to follow along as we're doing this you can actually download the scene in the video description of this video and that we can reproduce the steps I'm doing if that's the way you prefer to learn so the first thing I'm gonna do is turn off the fill light and the kick light here so that we really see what we're doing and then I'll go to the material tab and go to specular size and bring it down all the way to zero so that we can start replacing it with our own and Isel tropic specular feature there so I'll go in the shader editor and press tab to inspect this node tree and I will locate the group output to the right here and disconnect it and I'll bring it all the way to the top so that we can start fresh and just focus on this new feature that we're trying to make so the main thing that is different in an anisotropic specular eye compared to a normal one is basically that it's it's going to be stretched along the tangent of the surface instead of being this very bright spot so the way we're trying to reproduce this will be to start with a color wrap and I'll probably need a frame to put stuff into so let me just create a frame here and I'm naming any so tropic and bump up the size all right so color ramp so I'll do is shift a type color ramp and put it in there and I'll need an extra handle here so that I can create this sort of white section in the center here okay and I want to map this thing onto my sphere using its UV coordinates and if I go to the UV editor right now you can see that it already has some UV mapping it's actually just default fear and blender and it comes with UV mapping but the thing that's great is that it's perfectly mapped for our needs right now and I say this because I want people to know that you cannot just put this shader on any random object and it will work straight away you really have to do your job of unwrapping things in a specific way and I'll show you how to do it on an actual hair geometry at the end of this tutorial but but yeah just know that it works for this sphere because of the way it's mapped by default it just happens to work that way so let me go back to the shader editor and I will create the texture coordinate so shift a texture coordinate and I'll need a separate X Y Z so I will take the UV output here it'll plug it into my separate XYZ and then I'll plug just a Y value in my color ramp and then the color ramp into my group output and immediately you can see that my ramp has been mapped onto my sphere and the way it works is basically that it's evaluating every point that you see on this square here and it's going to look at this Y value because that's what we're telling it to do so it looks at the Y value and could be anything from 0 to one because why is in the vertical direction and it's going to use this value to decide what color it's giving it so if it's at the bottom it's going to be giving output of zero and so it's going to be at the very beginning of this car around zero so black and if it's the center going to get this this white here and then as it reaches the top going to be black again so that's why you can see it here so it's a good start but obviously it doesn't react as you would expect a specular to do namely as you move your camera you would probably want this specular to sort of shift around like a specular would right so what we're going to need is a way to extract value from the angle of the camera and relation to the object and we're going to be doing this using a vector transform app so let's take the vector transform here and I'm gonna change a few settings so let's keep it at vector leave it at world then change it to camera so we're going to be transferring coordinates from world to camera camera space and I'll change this to 0 0 and minus 1 so basically if you wonder in here it's a vector so it's x y&z it's a direction and we're telling it just we're feeling it a minus 1 direction so in the Z Direction Z is down this in this instance so we're transferring a world vector that's pointing down and we're converting it into camera space so what happens is that as I move my camera up it's going to give me a pure blue and it's going to be black when I look at from from the side so and what I'm gonna want to do is just add a separate RG or XYZ it's the same in this case and just use the Z value so that I get a black and white instead out in this blue so if I look at it from any angle is going to be black but as I go up it's going to be perfectly white as my camera aligns with the Z a direction that I've set up and the great thing about this is that I can use a math node I'll put it in subtract mode and if I put it here just before a color ramp and feed it my Z value it's going to change the y-coordinate before it's being fed to the to the car around here so you see it how it moves as I move my camera so obviously it's a lot it's much too much right now so let me just copy this and I'm going to change this to multiply and maybe put at that point 3 so like 30% of the of the effect we're just seeing so as you can see now sort of see this this ring on the other side well before you could just see like nothing like this so it's already much better all right so it sort of starts to react like you would expect the anisotropic specular to but it still doesn't look like hair because remember we want to use this for a hair shader so I want to start breaking this up with a noise texture so let me create a noise texture and put it here so I'll change this to 2d and this time we want to use the x coordinate okay and actually like let me show you the difference so if I were to just put the UV coordinates here so you would see a if I use a factor I'll everything black and white so you'd see a noise texture okay I could expect it but if you use just the x value the cool thing is that you can have just these vertical lines okay and and actually I'll show you on that point here so you can see better so apply the same material okay so you see these vertical lines that's what's being mapped onto your sphere and basically the way we'll be using this to this place or color ramp is that as you move on the x axis okay vertical line at every point of this x-axis is going to have the same value so if you move at point one it's gonna get maybe zero cuz it's like it's back and then 0.2 it's maybe he's gonna get one then point one and point two and etc so as you use these values to push against the previous color ramp your going to create this sort of wave pattern into it and so it's going to give it some texture so let me show it in action I will simply duplicate this let me just move this thing around okay to the side so I'll duplicate this change it to add now I'll just add it like this okay show you how it works so as you can see it's it's sort of pushed everything down okay obviously it's it's way too low right now so I need to adjust a few things first I'll duplicate this thing and change it to subtract so we're going to yeah bring it back in the center let's see that at 0.5 so sort of starting to look like something the node I like to use to control the the strength of this noise is a bright contrast okay so let's just type shift a bright contrast and if you bring contrast 2-1 the cool thing is it it goes back to exactly how it was but as you just pump it up just a bit you can start having this this noise this noise pattern to it okay and we're actually going to use a few of these noise textures stacked on top of each other to create a very very organic look to our sort of fake hair strands here so I'm going to rename this yeah I'm going to rename this high frequency okay so this is what we'll use to get doors those very have fine hair details and I'll pump this to ten ten like this okay and maybe - okay maybe like this and then I'll duplicate this thing and I'll rename this low-frequency use the same x-value to fit into the noise texture and I will once again push this that to the side I'll duplicate this ad note here you have a second one as I said we're stacking these on top of each other so I will plot my second one into here but this one instead of using a 10 and 10 or maybe I'll remove the detail here now I'll type five five zero five instead okay so it's going to be sort of a longer wave and we're sort of be able to can like it could be two if you wanted to so it would be a very like long wave or whatever obviously you can play with these values however you you see fit but I'm just giving you some options and then you can play around with the sliders and then I'll create a third one and this one is very useful it's going to be called potty nests and okay is that how you spell it with two T's I think so anyway okay so I'll duplicate I'll delete this and I'll use the X here and here I think I'm going to be using a bigger scale and okay this one is set up adding in here I'm going to use a multiply node afterwards okay so I'm going to be using this new nose this new sorry this new noise as a mask over everything else that we've built so that every white region is going to appear but everything is the black and my noise texture is going to disappear so we'll be able to create some negative space in between this because right now everything is connected I don't want some spots to appear so I will connect this here okay I'll bump up the contrast quite a bit so maybe a ten all right so as you can see if you play with the brightness now you can sort of create holes in there so you can just have a few spots or anyway you you understand so um all right let's just put it here okay so now that we've done this what I'd like is just to sharpen this just a bit more so I'll duplicate this color ramp but this time I'll remove the extra handle that we've created before and put this to a constant so we're going to get a very very super sharp edge remember this is procedural so you can really zoom in film free here and so you can play with this this value here but don't you have this and what I like now is to be able to have this slight effect somehow the specular highlight like it would feel natural for it to work like this right I'd like to have a hot spot somewhere and maybe a softer and is oh traffic in the back so that when you move the light you feel like the collide is coming from a specific direction so I'm going to use a me make some space here yeah just reorganize stuff a bit all right so I'll create a specular node here and we'll use this as a mask over all of this so I'll me the shader to RGB and a separate RGB and I'm going to use only the red channel and remember I need to do this because my key light is casting red light and if you haven't watched a whole two shader series that we've done you might not like immediately understand why this is casting colored lights so maybe watch part one to understand this RGB light technique if you're if you just want to plug this end user tropic feature on your own shader then you might not need this you're actually you don't need a separate RGB thing but if you are working from the shader that we've shown you so far then use this and so so as you can see we'll be using this thing as a mask so let's just change few settings I'm gonna change the base color to black I only want the specular bump the specular to white and change the roughness a bit so we have a sort of a general general area that points toward or a light here okay all right and we'll use this as a mask and there's two ways we can do this either we can put it after everything so let's try it this way first I could try it this way okay so as you can see as you can see it's just sort of lighted in this section and darker here but what I prefer to do is instead of putting it afterwards after to sharpen effect we're going to place it before when things are still a bit soft and then will sharpen everything up so that we will only still have either lighted section or nothing and it will create a pretty interesting result let me just show you so um let's put this here there you go and I just need to bump up the specular here alright maybe me even at maybe I'll bump it up to 1.5 so yeah now as you can see the nice thing is since we've applied it before you really get these these strands of hair appearing sort of out of nowhere and it looks more Hendron so I really like this style but I I would still like to retain a bit of the anisotropic in the back not to lose it completely so I'll yeah let me duplicate this color around here second time and I'll use a mix RGB to make the two together but I'm only going to be using a very small amount of the second one okay so I'm using huh yeah I'm using the Alpha so you need to plug the color there alright so I think I'll make this one not constant but just a bit softer yeah okay there you go so it's going to be creating some sort of glow around the lighted area just a general impression in the back of her hair strands here so it's pretty nice and there's obviously a lot of settings you can start playing with right now so you can affect how much your cover rep is being upset by your camera angle with this thing here and then you can increase the brightness I find it using this thing is pretty cool so it can increase the brightness like this or just have a very like just a few spots here and there you'll break in yeah that's pretty cool okay and all right I'll leave it at this so now if you want to control the color of this thing we'll need an additional mix RGB so yeah this is going to be plugging into the factor of this thing so we'll use the everything that we've built so far in black and white it's going to be the alpha of this new color that we're giving it and this is going to be the base color so this will be the color of an isotropic and then you can control the secondary thing here and then I think I'll create as another mix RGB and [Music] this one yeah and this one will be in color one the other black so that I can turn it on and off okay so let's start creating some parameters here and plug this back into our toon shader so I'll take this thing here I'm parented with alt P and I mean I'll need to bring it all the way down here so I could put it right at the very hand at the very end but I still want to have my outline after everything so I'll need to disconnect a few things so color it's gonna be a bit confusing color one okay so color one then this goes here this goes here car one there okay so I've just inverted the order of the outline and this one so this one is second-to-last and it just needs to recalculate stuff okay so obviously pink is not a great choice of color in this case I'll just choose a nice blue and maybe you don't need this plain anymore alright and so the first parameter I'm gonna create is so I'll drag this little circle in my group up input here and I'll drag it into my color here yeah and I'll rename this I need so traffic great bald caps just so that we really see the different sections a bit clearer and then I'll duplicate this group input oops out P and I'll need a few things here so we said just with control the opacity so what I call this opacity and as you can see it's sort of inverted right now one should be transitory opaque and zero should be transparent so let me just add an invert node here so that things and I need to disconnect it okay so nice it's updated so zero is now transparent one is completely opaque then I'll use this thing the factor yet this one so it's going to be our secondary mix so this one's going to control the amount of this second thing here in the back where there's no light thing and then we're gonna add general brightness so I'll use the bright in the in spot Ness I'll leave it I'll call it I don't know strength and then I'll use and offset I can use any one of those two subs tracks here as an offset so I'll use it on the high frequency call this offset so you can just move it anywhere you want leave it at 0.5 and the last thing I'm gonna use is the yeah so where there's this vector transform there's a multiply node we're gonna use the value and a multiply node and this is going to be our camera angle offset so difference between these two is that offset is always going to be offsetting this thing no matter what angle we're looking at it but the other one is going to only affect the offset if I'm looking at it from the top so if I'm lucky guys from this side I can play with this value it's not going to change anything but if I'm going to look at it from the top it's going to have a huge effect of where it ends up so it can be super pinch at the top or just stop before okay so there you go it's pretty much it um so as I said you can really play with these values however you want depending on the style you're looking for it can really increase the frequency of these things and make some very very fine hair if you want to I mean there's really no limit to what you can do and you could even like create a tons of parameters here so we can tweak the settings outside in material I'm not going to do that right now just because I'm running out of time but I mean go wild and do whatever you want have fun so I would probably normally end the tutorial here but I promised that I would show you how to show you some of the techniques we use to paint textures and I also said that there's a specific way you need to unwrap things so what I'm gonna do is close the scene and in just a few moments I'll open up a new scene with one of our characters and I'll show you how we would go about applying this material to the hair of our character paint some extra details painted like texture over it to give it some character so see you in a bit okay so I've opened up my scene with our character iris here from our project Dino monsters and just so I can show you her hair I'll turn off the cloak and as you can see so this is the hairpiece that was talking about that so we used our anisotropic share on it as you can see the specular follows the direction of the hair strands and it even works in the back where you know the direction does not follow at all direction of our previous sphere but it still follows the direction of the hair strands so I'll show you how to do that and so I'm going to turn off this final hair here and activate this hair piece that doesn't have any UVs at all and I'll show you how to start unwrapping this so it works so I'm going to pick this piece here just on it success an example and okay and I'll go you and project from view and if I press L I can move this piece here and what you want to do just as with your sphere before is instead of having this sort of thing ending in the triangle you want to end it as a perfect rectangle so all these areas here you want them to align perfectly and and as you can see as I select this line here I also select some stuff and the bottom here and that's because I'm in a UV sync mode so if you want to select some edges it's often better to on sync things and then select your whole model and then you can select your your edges so let me turn off the partial modeling and I'll just select these with alt click and a scale with s and then s pressing X to scale in the X direction so very quickly I'll just press s y sy SX yeah so get the drill it's not the most interesting thing to watch show I'll just end this here you understand the standing principle so as you finish trading straightening all these lines here you can see this specular starting to appear and the cool thing is that you can scale this horizontally and vertically to affect the shape it has and once you find a cool shape that you like it's always going to retain that shape no matter the angle you're looking at it because it's using the UV it's applying the noise texture on the UV coordinates so it's like if you were texturing this piece of thing so this one is pretty easy because it's already aligned with our with our Cameron though the world coordinates but let's take this piece here that's not aligned at all like our sphere was so the way we'd do this let me switch to shape face selection mode so I'll select this piece here maybe up to here and make sure I'm not selecting stuff in the back okay so I'll press you project from view then I'll select this other piece here and do you you project from view okay so I'm selecting everything by pressing L okay so what I need to do is align this thing like the sphere was previously so you see all these things that's sort of curve around and end up in the tip here what I need is this to be completely straight and all these lines to be perfectly perfectly straight horizontally so it takes a bit of work it probably took me a couple hours to do the whole hair model on their firing final character I'll try to do it in a few minutes here so that you are not bored to death and once I'm done with this piece here I'll need to do the same on the other piece I don't need to weld them together so let's say it's almost good enough just need to maybe do this piece here okay almost good enough okay and I need to piece this back together but the other thing here so I'll activate you vsync and that way I can in edge like mode see those things light up that means they are connected so if I select them all at the same time and press V going to suggest me welding position and I can weld them back together you just unsink the stuff and there you go so we can continue straightening things up and yeah so we'll say this is good enough so as you can see now my specular is turning around and nice in the good direction and if I were to rotate this you see I could sort of influence what direction they're going but since I've aligned them perfectly that's why they follow the right direction and I can as always scale this up and down horizontally and vertically just you know will depend on your model and and what you're trying to achieve but that's the general idea so let's say I've done all the unwrapping on my thing looks like this and I want to start applying some texture to it so let me just show you for example what we did on file hair we added some a dark outline here that go over the specular and some painted shadows here that the that go under specular so there's two methods being used here and I'll show you how to do a to do both so I'll turn off my final hair and activate final hair well here with no texture and show you how to do it so I'll go in my shadow editor and first method painting underneath my specular so I'll create a new image texture and it's going to be I'll click on new and I'll click this times for call this hair texture mask turnoff alpha and all right so one thing we need to do first is do a second set of UV map because let's look at the UV map UV map right now so this is UV map for this piece of hair it's all over the place and it's normal because we were just placing things in a way that makes sense or this anisotropic specular and we need to do that but it's really not useful to apply texture to it because it goes outside the square things are overlapping so we're going to create a second set of UV map to use for textures so go into your object that you're the little green triangle and then you see UV maps here I've already renamed this any so traffic UV map you can create another one I would call this texture UV map so let's leave the little camera icon on this one so it will use this one by default but I can still go into that one and select all this stuff and go to UV pack island so now I have two different UV sets and this one I can actually paint textures over I could even minimize stretch here and then if I go back to my shader editor if I create a new UV map node I can select my text view map and plug in to my hair texture mask that way is going to be using this one which you can actually paint extra over so to paint texture under my specular I will create a mix RGB node and plug this color into my factor so we're going to be painting a mask actually not a texture and this mask ego is going to drive this new color that we're going to paint so Kara one is going to be the previous base color that was using and color too I'm gonna pick the color but make it just a bit darker and then I plug this into base color and you're not going to see anything obviously because it's all really it's it's just black at the moment but if I go to texture paint go hair texture mask now I can paint need to paint so you're you're going to be painting white or black which is just so bike and white texture and you can sort of paint some darker region so there's a bit of delay here because I've activated an establised stroke but your you can just erase stuff by pen thinking black and white and you really don't have to worry about like picking the right colour or anything it's really just black and white you cannot mess anything up and you can always just select the color that you really want here afterwards so that's the nice thing you paint the region you want and then you can adjust it later on so I could sort of try to match my shadow here if I wanted to so yeah let's say let's say it's like this so this is the first method the second method we're going to be adding a new node in our node setup to be able to paint over everything it's going to be very simple I just go in there press tab go at the very end here and create a mixed RGB node and let me just cup you my group and put here okay zoom in so you can see what I'm doing so make sure our GB I'll pull it just before the group output and we'll be creating a new parameter for so I already have parameters here so painted over masked I'll plug in two factor and paint over color I'll put in two color two and color one is going to be what the previous number was and then this is going to be plugging into grew up output so perfect I can jump back and there you go if i duplicate this thing here I'll just create a new one it's going to be hair or whatever air mask over and this one I'll just plug into my painted over mask here and I'm gonna choose the color of my outline because I want to paint with the same dark brown and then if you go to texture paint let's see if my new texture has appeared not yet so maybe I'll just go to the object mode and switch back to the texture again just so that it can update oh yeah so hair mask over there you go so now I can paint with white and there you go I have stuff that appears over everything and I can just like paint whatever I want and I'm using control to erase so it goes pretty quickly and once you're done you just know you need to go to shift press shift f10 on going to you UV editor or sorry the image image of the turd press shift f10 twice whatever and you'll fetch your hair texture mask and you save it save as save it wherever you want save it on my desktop and your others our texture hair mask over you save it too because its might not save as you save your blender file and there you go so that's how we painted our texture on all our characters and that's how you need to unwrap your hair so that the end user traffic you feature that we've made works on any geometry so I hope you've learned a few things let me know as always if you have any comments and the team will answer you as quick as possible and until the next tutorial be safe I'll see you next time [Music] [Music]
Info
Channel: Lightning Boy Studio
Views: 101,839
Rating: undefined out of 5
Keywords: Dinomancers, Lightning Boy Studio, Official Lightning Boy Studio, Dinomancers Tutorials, Free Toon Shader Tutorial, Free Toon Shader Blender, Blender Hair, Blender Anisotropic, Blender Anisotropic Hair, Blender Anime Hair, Anime Hair 3D, Anime Hair tutorial 3D, NPR blender, Blender 2.8 toon shader, blender anisotropic shader, toon shading, toon shading hair, blender 2.8 anime hair, blender 2.8 toon hair, cell shaded hair, cell shading hair tutorial, blender cell shaded hair
Id: kxWWBmIUxbc
Channel Id: undefined
Length: 39min 54sec (2394 seconds)
Published: Wed Apr 08 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.