How to make a fully procedural skin shader in blender

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
all right hey everybody so today i'm gonna be releasing my uh fully procedural fully customizable skin shader i've made six different presets but they use they all use the same two node groups so if you want to pick those up uh you can check out my gumroad for the first week it'll be completely free and it'll include a blend file with all the six shader presets as well as a demo scene which is the first image that you saw it'll also include a 2k 4k and 8k uh diffuse image textures of each of those presets and yeah and again for the first week it'll be completely free so what you see here is i have uh these are all the six different shaders just with the spheres and so some of the different things that you can control are things like the amount of redness blueiness and uh yellowness on the face you can the strength of that you can control the height of it you can control the amount of blush and change the amount of blood blue blood and veins you can change the color of the skin saturation of the skin and lightness of the skin can also change the amount of noise that's in the subsurface changes roughness and the contrast of the roughness and in the bump node you can also change the stretching of the fat around the normals the noise the noise size of the fat the amount of fat the bump strength of the fat can change poor stretching for amount poor size poor contrast poor pump strength and also wrinkle stretching wrinkle noise size wrinkle noise strength wrinkle size slash amount and wrinkle bump strength and with that you can create a whole variety of different textures clean almost any different skin color skin texture and basically any type of skin that you'd ever need and if you want to delve into the node groups then you have even more control even more precise control over the results again you can use this for things like uh stylized things you can use it for realistic things uh one thing that i recommend is that you bake it out because it's really dependent on ambient occlusion ambient occlusion and pointiness which only really work in cycles so baking that first would be really helpful because those again take a really long time to calculate and you'll just save yourself a lot of computing also a couple quick disclaimers this is a really heavy shader so i'd really highly recommend optimizing your render settings so turning off things like caustics especially and then turning on uh approximated gi because that can really help your performance and then yeah so some of the things that i've changed for the presets are i've just gone into the nodes changed the hue of the skin and the lightness of the skin which are the two of the presets that are two of the sliders that you see and then in addition you can change the strength of the the blue blood and the veins and all of that and then i've also gotten some notes a little bit and changed things like some of the contrast so yeah and yeah those are the notes have fun with them all right so i'm just gonna open up a new file get rid of that ungodly thing and yeah i'm gonna just take this model that i made and then i'm gonna move this around a little bit and the first thing that we're do we're going to do is i'm going to change all my render settings so and get rid of this material first all right so the first thing i always do is i always turn down the background light strength to zero so that's completely completely black because we don't want any outside sources of a light other than what's completely in our control so first thing i'm going to turn on ambient occlusion try to pre uh trace precision and then let's go down to screen space reflections turn off half restress trace half res trace sharp trace precision max roughness and edge fading although all their max settings performance turn up high quality normals shadows high bit depth and yeah that's it for our eevee settings now we're going to cycles again i'm just using ev for my while i'm working but i'm gonna be using cycles for anything final so here i'm gonna go into light paths turn down transmission transparency and glossy by two or turn down glossy by two and then turn down all the rest of them to zero turn off reflective and refractive caustics turn up fast gi approximations go down performance turn these to 256 pixels and yeah those are my uh cycle settings i'm just gonna go into my eevee setting thing and then we'll start making the shader so i'm just going in shader editor give this a new material and yeah let's get started so the first thing that i'm going to do is i'm going to grab a geometry node then a color ramp plug pointiness into the factor of the color ramp put that into a viewer node and if we move these around we can see actually let's go into cycles for this because this is dependent on us being in cycles because for some reason doesn't work anywhere else or an eevee so yeah so now i'm going to give this a basic skin color actually not i'm gonna cheat a little bit and grab the color from this one because i don't feel like finding that color again so go here and let's get out of there and put that in and wow we have a skin color so yeah that's do that now what i'm gonna do is i'm gonna go turn that up give our inside thing a red color and that'll kind of simulate blood yeah blood and then what we're going to do is we're going to grab a ambient occlusion node and copy this color ramp and now we're going to do our blush so what i want to do here though is first turn down the saturation so it's completely white because when we multiply these two together we don't want any weird things to happen and white in a multiply color just means that no there is no change so yeah now what i'm going to do is i'm going to bring this white part over i'm going to go into ev for this so i'm going to bring that red part over and then the white part over until it looks good it's not going to look good right now but until we get the desired effect so what this simulates is kind of blood on the outside of the skin kind of like blush a little bit and now i'm gonna move those over a little bit get a mix rgb multiply we're going to put those in there and then we're going to set this to multiply and we can set this factor to however however much we need and i'm going to demonstrate this in cycles because again edge data and when i refer to hd edge data that just means the pointiness factor from the geometry node so this will change how much strength we give the blush and you know i'm gonna and bring these closer together so i can give them a bit more contrast so now that we have that what i'm going to do is let's see so when you're painting faces there are generally three sections of color on the face so if i go around here you have a section of blue then a section of red and then a section of yellow on top so we're now going to try to simulate that so we're going to grab a gradient texture where is that okay so yeah gradient texture then press ctrl t to grab our texture coordinates and then grab a color so we're going to set these two is in our blue our red and our yellow it's more gonna be of an orange yellow so that the colors mix better but yeah so i'm gonna then set that to constant because then we won't get any of that magenta from the red and blue and then just kind of move these around a little bit and then what i'm going to take a noise texture put that into my texture coordinates and we're going to use our object coordinates for this then we're going to take a color mixed rgb and set this to multiply then what we do is we multiply those two together and we have our kind of gradient between them so then we can set this to however however much noise we want in that and then let's see i'm gonna rotate this by 90 degrees and then set this to 0.4 so that they're in the right sections and then i'm going to set my z scale to 0.6 and that'll get a longer transition there's a point nine let's try 0.8 so and then i'm gonna so i'll trim the scale to 29 detail to max roughness and then distortion to 1. so now what i'm going to do is i'm going to bring this up to the middle of our face and voila we have it generally in the right sections and yeah so we have that effect that we're looking for but the thing is we don't want this to happen all over the body and we just want this happening in the face so we need a way to restrict that to just the face so again we're going to take a gradient texture and then control t rotation on the y axis by 90 object coordinates and i'm going to turn the scale down on the z to around 0.5 and then we're going to move our location until let's say just around the bottom of the neck so now we're going to do is we're going to take a converter math node and set this to add and this will change like how strong it is yeah so then we're gonna put a invert color node into into that so it changes from there and then what we can do is take a we're going to take a color mix rgb and then have this node as our mix factor then we can take this node that we made here plug that into the top one and then this one we can put into uh the bottom for now and then that'll give us this effect so basically what this is doing is it's telling where each of those will be allowed to exist so this can only exist on the top of the head i'm not really good at explaining that but yeah so now we're going to do a little bit more work on this so we're going to do is we're going to get a texture a noise texture ctrl t object coordinates a color ramp plug that into the factor and you voila so what we're going to do with this is we're going to try to use this noise texture to simulate blood and so first thing we're going to turn up the scale just to tad detail all the way up roughness to around say 0.8 and distortion to 0.5 and we're going to turn up by just by moving these uh sliders closer to each other we're essentially increasing the contrast but in a much more controlled way so whenever i say increasing contrast this is usually what i mean so now we're gonna make this red and voila and we can change how much you want so i'm gonna do that then i'm gonna duplicate this and i'm going to make this blue because we have a little bit of like blue blood if you will or what looks like blue blood and i'm going to make this slightly not completely blue and then what i'm going to do is i'm going to turn move the location a little bit and then next thing we're going to do is we're going to make veins so we're going to use that same noise texture but we're going to turn down the roughness until we get something like that and then move these closer together so we get kind of more wispy stuff [Music] we're gonna change the scale on our noise texture a little bit and i'm gonna turn the distortion up a little bit and yeah so this is our kind of like vein thing but it also kind of it can also kind of look like bruises which is really good for our old person texture or a wrinkled person texture so now what we're going to do is i'm going to take a take this multiply node and then put that right there so we have this texture that we made and then we're going to plug this in here and by doing using multiply we can change how strong the blood is so right now we're just going to leave that at 0.5 we're going to duplicate that again plug the one that we just made into the top one plug in our uh blue blood into next one i'm going to eevee for this so yeah i'm going to plug that into that one then duplicate this and do the same thing for our vein things and voila so now basically we've combined all of the textures that we made so far so that it they all show up and i'm gonna change this a little bit turn up the roughness and this is essentially our diffuse texture and again uh by changing the factor on all of these we can change the strength of the blush the strength of our red blood the strength of blue blood which i'm gonna yeah and then the strength of our vein things so now that we've done that there's still one more thing that we need to do is we need to connect it to our red or our yellow red and blue texture so the way that we're going to do that is we're going to use this mix thing that we made and then just switch switch that with our now mostly finished skin texture so now uh the effect of the blue and the red and all that is a bit too strong so what we can do is just change the strength of that through our ad node and by going up in value we can change how strong it is so i'm going to stay around point eight nine is the one i believe i used actually let's go to eight that's better and then i'm also going to turn down the strength of her blush a little bit turn up red blood turn up blue blood tad and this is essentially your diffuse texture but now what we still need to do is our roughness and subsurface because if we just take a look at it right now it doesn't look very good because it's just yeah it doesn't look very good so and the reason why that is is because of just how inconsistent the real world is when it comes to roughness and stuff is the most things to ever exist don't have a consistent roughness so what we're going to do to simulate that is we're going to take that diffuse texture and put it through a color and this is a really heavy shader so make sure that you're saving a lot so now that we have our diffuse texture we run that through a color ramp and voila so we're just going to use this to drive our roughness and when you're doing roughness you always want you're almost always want a really high contrast so i'm going to bring these together until i have the effect i want so now that we have our desired level of contrast what i'm do is i'm going to pick our almost final roughness value so bring our top value to say 0.8 and then our lowest value to 0.5 because if we kept it at zero then it basically turned the skin into a mirror which doesn't really happen a lot so yeah and then let's see and take that and then grab a color brightness contrast and then what this lets us do is use this as an input in our final node and that kind of just lets us change as a whole what our roughness is and how much contrast we give it we're not going to mess with that right now so yeah and another thing we do is i'm going to grab a color hue saturation and plug that into our mix thing and yeah so then we can use this again as an input for our final node now yeah so this is what our roughness is going to be and grab those plug this into our base color and now we're just missing one thing which is our subsurface so what i'm going to do for that is i'm going to grab yet again another ambient occlusion node now i'm going to grab a color ramp and who would have guessed another color ramp and we're just gonna use our diffuse texture as one of our parameters for subsurface and then also our ambient inclusion as another parameter for subsurface so this time i'm going to turn on on the inclusion node i'm going to turn on inside and then i'm gonna color mix rgb set that to multiply also blender doesn't crash i'm gonna save because it's probably gonna crash while i'm recording so let's call this skin test v2 so let's see multiply these together and yeah so in the node that you guys saw our factor is oh boy so yeah basically our factor is controlling how much of our diffuse texture shows up so let's put this at 0.9 and again we can see our diffuse texture showing up and our my computer's been slow so this might take a while this is controlling how much of our diffuse shows up and i'm gonna let's go into cycles for a second so if you can see here what this is basically doing is all the white areas is where subsurface is allowed to happen and all the black areas are where there's no subsurface and so what i'm gonna do is i'm just gonna switch these because basically we want the most subsurface to happen on the really protruding parts of our model so that would be like the ears the nose and the eyelids and this does a really good job of that and then i'm just gonna bring that in so there's a bit more contrast and again here i'm gonna bring those in so there's a bit more contrast again and voila we have our subsurface parameter and what i'm going to do with these is see i'm gonna grab these put them over here for a second and then grab yet another color ramp and so basically what this will let us do is control our subsurface as a whole so we don't have to mess with each individual part like the ambient occlusion enter diffuse and generally these values are almost always going to stay the same so i'm going to put our lowest value at zero and highest value at 0.2 and those will generally average out at around like 0.1 or so again with the most happening around the ears and the parts that protrude a lot yeah so you can see that effect here and i'm going to save save a lot and this is generally our note tree for our diffuse so now let's move on to our bump which is going to be our fat our pores and our wrinkles so i'm really excited to show you guys this part because it's probably already been thought of but i really i think it's a really cool technique so yeah i'm gonna scale those in a little bit grab those and just move them out of the way so what i'm going to do is i'm going to grab a voronoi texture and if you see me pausing i'm just looking at my original notes just to make sure i'm doing the right thing so i'm going to grab that ctrl t object and this is going going to be our fat so who would have guessed we're going to use another color ramp and yeah so i'm going to move these and voila it looks like fat but here's a really cool part is we can change how much noise the fat has like around the edges and how much it stretches around the model and i'm just gonna turn that up a little bit so we're gonna do is we're gonna grab that okay a noise texture uh then a mix rgb or sorry wrong step uh mix rgb grab our object coordinates put that into a color too and now through this we can change how strong the noise is and then much the size of the noise looks like right here and i'm going to turn up the detail roughness but i don't want to go too high with the roughness because then that will start to look like pores and we want to keep those entirely separate and i'm also going to turn up the distortion just a tad and i'll put this at around point nine two let's say and voila we have our fat so i'm just gonna unplug these right now so we can save a better performance and grab our vector bump put that in there normal and all right so now that we have actually almost forgot so we're going to do another really cool technique which i found all right i hope i discovered it but someone else probably did it so i'm going to take a mix node plug that into the object coordinates and then grab our normals and plug those in and what that'll let what that'll let us do is change how much it stretches based on the normals so you can see here if it's just at one then it'll have no effect i won't be affected by where it's protruding and stuff so i'm going to and if we set that to zero it's completely affected by the normals so i'm going to set that to around point nine so basically it stretches just a little bit around places like the nose and around the eyes and then i'm gonna so yeah it's really cool and i'm gonna turn down the scale on my noise a little bit because again we don't want yeah so we don't want any pores for this part because we're going to do that in a different node group and yes let's get started on this so i'm going to grab this foreign texture and ctrl t again object yeah someone turn up to let me see today i'm going to grab a uh invert uh brightness contrast and let me see yeah so i'm going to then grab noise texture actually no not nice texture like just a mix rgb for this one again do our object and normals and i'm going to turn up the scale for this one because these are going to be our pores and by changing the brightness we can change how large or close together our pores are and then contrast we can change how gentle they are so i'm going to do pretty harsh for this one let's go around maybe five and then turn down my brightness and then turn up my scale a lot not too much though let's go 250 oh my god and then turn down the stretching so in the original node this is how we control our stretching for each of the maps are for each of the pumps and [Music] yeah let's let's stick with that for now and now we're going to do the wrinkles so i'm going to grab a foreign texture shifty and no i'm just going to copy this whole thing what we're going to do here is we're just going to bring this in a lot and type scale and then what we're going to do for this is we're going to go into our f1 slot and then change that to distance to edge and that will give us this kind of scaly effect and then we bring the contrast to very high and then this is what our wrinkles are and again we can change how noisy it is and then also size of the noise stuff like that and again how how much that stretches so i think this is a good place and yeah so this is how we get our wrinkle texture so now what i'm going to do is going to grab a effector bump another bump and another bump so the first thing that we're going to do is we're going to plug our fat into the height and let me see this is the effect we get and then i'm going to plug the brightness con our pores which is the second one that we made into height and then that bump node into the normals of the first one and then let me see just a second so if we take a look at this node for our pores right here we can see that if we just left this as is our pores would be sticking out rather than protruding in so we're going to grab we're going to tick invert and that'll have those pores facing in and then again for our wrinkles we're gonna put that into height and then invert so that our wrinkles are facing inwards and then plug that into the normals of our pores and now we have a fully created normal bump map thing and let me see yeah so i don't usually like to have the fat super strong because i want that to be super subtle so i'm going to grab put that at around let's say 0.1 let's see how that looks and yeah get a very beautiful effect so i'm gonna camera view real quick and then let's go to cycles hopefully it doesn't crash so if you can see how slowly my mouse is moving it's it's incredible so let's see if i can zoom in a little bit without it crashing and let's try putting this at one just for demonstration so yeah so as you can see that just kind of breaks it and that's why we don't want to have the fat too strong so let's try point three again too strong so stick with point one and yeah that's our normal map or bump map sorry and it shows up better on eevee just because it doesn't render as well so if you're just looking for to see how it actually looks then definitely doing cycles because that's probably what your final render is going to be in so you want to kind of practice how you're going to perform so yeah in general bump and normals act really different in ev than they do in uh cycles so that's generally why i prefer cycles because just easier to get a good result and yeah so now what we're going to do is we're going to turn these into our group notes and yeah so the what we're going to be using as our inputs are again our fat stretching fat size fat strength fat amount fat pump pore stretching therefore our bump node uh poor amount for size poor contrast poor bump poor strength or wrinkle stretching wrinkle noise size and yeah let me let me show you guys so let's grab all of these and then press ctrl g and voila we have a group node so what i'm going to do is for our strap for our fat stretching if you can remember it's where we used where we mix our object in normal coordinates so i'm going to grab one input then when we want to change our fat noise size we're going to be changing scale so just plug those in and when you want to change fat noise strength that's our second mix and then what we want to do is for fat amount we use our scale and then for our fat bump strength we're going to take this all the way over here and plug it into strength and then for our pores we're going to do our poor stretching and see poor [Music] size and then poor contrast and then for the strength we're going to just put that right there again and we're going to do the same thing that we did for our first one for our wrinkles so i'm gonna do that there for the stretching uh noise size noise factor wrinkle them out and then let me see and then strength and this is our bump node and i'm gonna just move this and then if we go tab and to bring up our context menu we can go to factor and then let's do stretch fat noise size fat noise strength fat amount and the like so i'm just gonna name all of these real quick bye and voila we have our finished bump node so again if you want to take a look at these yeah so now we're going to do is we're going to do the same thing for our diffuse roughness and uh subsurface or press ctrl g and now that they're all in a node they're in what node group let's get moving on all right so for this one the controllers that i want is our the blue red and yellow height thing so we're what i'm going to do here is yeah so what i'm going to do here is put one for location and another for scale so we can change how tall we want our factor to be for the thing and let's see and what we're going to do is right here we're going to so we're going to put one into our top value and that'll be able to change our strength the strength of the blue red yellow effect and then let's see next we're going to do our blush strength so i'm going to put this one into the factor of our multiply and then another one into the factor of our second multiply for our red blood and then another one into our third multiply for our blue blood and another input to our veins and for our vein i'm gonna wanna to input into the scale so we can change how how much vein we want and how big of a vein you want and then let's see next up is our a skin hue so i'm going to grab an input and put it into our hue saturation node right here so one into hue one in into saturation and another one to value so what we're controlling here is our skin color skin saturate skin saturation and the skin brightness or how much black is mixed in or how bright or dark the skin is and then yeah that's it for our diffuse so next we're going to go into our subsurface so i'm going to put an input into let's see our thing and this is what's going to show going gonna control our subsurf noise if you will which is basically how much of our diffuse we're multiplying with the ambient occlusion node and then we're gonna use that to uh let me see yeah and then so next up is going to be roughness which we're going to control here so this input into the brightness is going to control our general roughness and then here is going to control how much contrast there is between the roughness and those are all of our inputs so now we're going to do our outputs which are going to be diffuse then subsurface and then roughness and then if you want you can go ahead and label all of those and yeah and then we have our finished diffuse roughness subsurf node which in the blend file that i've included on my gumroad i've just called that the basic texture and then i've called this one the bump texture and in general they're all going to be named by what preset it is so it's going to be named either general skin color young skin color i wrinkled and then basic or bump for each of them and yeah that's how you make your uh your note groups and one more thing is while that is pretty much it i i'm gonna set the subsurface color to a slightly pink color because i just feel like that helps to realize a little bit and yeah that's how you make the notes let's hope blender doesn't crash oops and again like i mentioned earlier before i end all right so before i end the video i want to remind you guys that you should pretty much always bake out your diffused texture at least because this shader is missing this wasn't a couple things but basically one ambient inclusion takes a really long time to calculate so that'll save you a lot of time in the viewport and it means that you might not crash as much and then second of all you want to be able to paint in things like lips and around your around the eyes because sometimes it'll either be dark or if you want to add like eyeliner or something then you want to paint those in so yeah make sure to bake those and when you do bake those you want to make sure to turn off all of your lights in both render and viewport and then turn your world lighting to a flat white and that'll calculate or that'll make sure that your lighting is completely flat to get all of the ambient occlusion correct because in this case the way that we're using anime occlusion isn't for lighting but rather for non non-lighting effects so we don't want any lighting interfering other than the flat road light and yeah that's how you make the skin shader and if you want to check out my gumroad it's going to be free for the first week and then yeah thanks thanks guys for watching you
Info
Channel: Sanjay B.
Views: 4,867
Rating: undefined out of 5
Keywords:
Id: EggVDD9bLvQ
Channel Id: undefined
Length: 66min 48sec (4008 seconds)
Published: Sat Aug 14 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.