Procedural Skin Shader Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
skin tone texture roughness blemishes subdermal tint veins every person's skin is unique there are so many variables that the idea of creating a procedural shader can seem a bit absurd and in many ways it is but assuming you have a decent mesh there isn't any reason you can't approximate a good skin shader and in this tutorial we'll do just that this is intermediate and i will break down the steps to creating a universal controller to create custom skin materials for characters in blender we will further go on to tweak the controller for variations on a single skin tone and use uv masking to assign certain variations to certain regions of the mesh the final product is a bit ram heavy but with a bit of uv baking you can create an infinite variety of skin materials for your next character project first off if you're just here for the nodes here they are please excuse the mess and for those of you looking for a bit more of a walk through let's get into it [Music] first things first you want to set up your scene i have brought in a base mesh for an arm and also i have a suzanne the monkey here on susan i have a subdiv modifier i've also got the background set to transparent which you can go up to the settings and go down to film and set the background to transparent i also have the environment set to a gray you can change it down to a black or any color really or an image texture but i'm going to keep it at sort of a darker midtone gray i've got one light in the scene just pointing at the characters and i also have a sun [Music] so i'm going to create my material here starting with a principled bsdf shader and i'm just going to rename it procedural skin shader [Music] okay we'll start out with the skin color and freckles uh or birthmarks so starting out here with a noise texture i'm gonna run it through a color ramp and into a mix rgb node [Music] i'm setting the top color to the skin tone and i'm setting the bottom color to the freckle or birthmark tone and then what i'm doing here is uh adding a texture coordinate and a vector map you can adjust the size of the noise texture and the distortion and roughness to change the shape and overall size of the freckles and shifting the color ramp white and black values here and there will also adjust the negative space in between each freckle so how many there that are there how large they are etcetera and that's pretty much it and you have your basic skin tone next up is the subdermis i'm going to create that using a texture coordinate into a musgrave texture that must grave texture will be sent into a color ramp and then into another mix rgb node which is sent to the subsurface starting out here by plugging the color ramp directly into the subsurface so we can more easily see the pattern that it's creating and adjusting the sliders here will make it a little bit harsher or a little bit softer depending now i can choose my colors and i'm going with more of a reddish tone here just like a variation on the skin tone for right now [Music] [Music] next we're going to be trying to replicate some different textures so to start with we'll be doing cracks uh very very small ones and we'll achieve this with a varanoi texture that's also connected to the texture coordinates i'm connecting all these texture coordinates into the object slot anyway i'm going to also be blending in a noise texture with the voronoi texture so you can see here i'm just kind of tweaking the size and you know the scale to make it a very very fine noise the way that this reacts to light when you plug it into a bump node is really cool and already makes it look more like a skin tone so for the voronoi texture this is pretty important you want to set it to distance to edge and you want to plug the distance into another color ramp and you can see here just adjusting the sliders will create this sort of cracklature that's very similar to a skin texture i'm bringing the white pretty much all the way over to the edge to create that you can see here i've got that plugged into a bump node and i'll be mixing them both with a mix rgb node and now i can kind of pan in between them and adjust how much of the noise i want versus how much of the voronoi texture and really that's another matter of preference but once you get that dialed in you can adjust the settings on the bump node you really don't need a ton so you can have the distance and the strength set fairly low and still get a good effect now that that texture is complete i want to also add some pores in here starting out again with another vernoit texture and this one will get its own texture coordinate so ctrl t if you you use node wrangler we'll plug that directly into the bump node here i'm plugging the distance into the height of the bump node now i want to add a color ramp and dragging the white over and tweaking this scale a bit you can see dragging that white over creates some fine circles on the surface so in order to adjust that we can adjust the randomness here and further tweaking on the color ramp will create some size variation as well now we can plug this in to another mix rgb node and blend that in with the top two the cracks and the noise and run all three of them through the bump node adjust the factor to adjust how much of each texture you want to come through and that looks pretty good i'll probably just shrink it down a little bit next step here i'm going to create some veins which uh end up looking surprisingly realistic and kind of gross so my apologies we're going to go up here in between the skin tone and the subdermis and plug a musgrave texture into the texture coordinate i'm gonna now run that through another mapping node and run that mapping node into a paranoid texture this will create kind of like a distorted pattern sort of reminiscent of veins next we'll run all of those through a good old color ramp and we'll select a color for the vein uh you know simple with just like kind of a blue tone and we'll keep the other color white because we're going to run this as a multiply in a mix rgb so you won't really see the white but it will help to blend out the color of the veins so they're not so sharp we can mess around with the musgrave texture here try to achieve something sort of wiggly and veiny looking it's very easy to kind of make it look more like an abstract pattern and less like veins but this gives a good visual approximation and it's all set in the sub-dermis so it actually looks pretty good when when it's all resting in the mix here so i'm setting my color ramp to ease mode [Music] and really just tweaking the settings until i find something that looks really good and that looks veiny enough for me now i'm creating another musgrave texture this is going to act as a mask for the veins so that they don't appear over all of the surface and we'll be able to adjust this accordingly but i'm plugging that right now into the main color slot just so we can visualize where everything's gonna appear and now i'm plugging a mix rgb into the subdermis color we'll be mixing that into the veins so that they appear under the surface of the skin and set the mix rgb to multiply this must grave texture looks okay we're going to plug that into the factor that way we only see the blues coming through and as you can see here it's starting to look a little gruesome but uh fairly veiny which is what we're going for and you can see adjusting the musgrave texture adjusts how much of that vein actually ends up coming through in the image now we can plug the skin tone back in and adjust the subsurface so that we're seeing the amount that we want [Music] now creating another mix rgb here in the texture or the bump branch and i'm going to be mixing that in with the output of the subdermis and i'm inverting it because the darker areas which represent the veins that's what we want to be bumped up so inverting that channel will bump up the veins [Music] and that for the most part covers everything all the elements that are going to be in there it's a mess to look at and of course if you're a neat freak this is probably going to drive you bananas but you know you can clean it up especially if you're good with node wrangler i'm going to just leave it because it's all going to be hidden behind a controller anyway so the next step will be creating the controller all right so i want to get all of this and send it through a group input node so create a group input node here and the first parameter i want is going to be scale i'd like to control all three xyz with one value so selecting the scale input of the texture coordinate i can plug that into the group input that'll create a controller and now outside of that group controller i can add a value node and plug that into the scale that will make a single value that will control all three x y and z scale i'll rename it overall scale and continue creating plugging in parameters so here over here in the group tab you can see we have scale and this is where we'll be adding new inputs and renaming them to make everything a little neater and more convenient next i'll plug the color value for the skin tone the base skin tone into the group input and rename that base color we'll do the same for the freckle color and so on we go plugging in the sub dermal color and the discoloration [Music] next i'm going to plug the scale of my initial noise texture in that will be controlling the freckle scale [Music] and definitely also want to be able to control the roughness this will give the opportunity to make the skin look damp or shiny or really really matte and that's very useful so we'll plug that in no need to change the name there we can take the scale from the crack voronoi texture and plug that in and we'll call that the crack size it's a good to have that independently controlled also the scale of the musgrave mask on the veins uh is helpful so taking that scale you can plug that in and that'll be our vane visibility now i'll plug the strength of the bump node in that will be the strength of the overall texture uh so the overall bump and that'll control the cracks the noise the pores and the veins we'll call that texture strength and for good measure i want to be able to control the amount of subsurface that comes through so for that we're plugging the subsurface and getting that uh giving that a controller as well i noticed a few things that i would like to add so i'm going to go back in and take the mix factor for the veins and the rest of the texture and i'm going to give that its own controller that way we can adjust how much of the vein bump is actually showing up because if i don't have a separate controller for just the veins even if i lower the discoloration uh it'll still be bumpy there and that can be unattractive in certain areas so definitely want to be able to control that i also think i want to add a map range for that must grave texture and that'll act as a color ramp will but it has these outputs that i can control with this controller so it it operates almost the same way it's just the controllers are something i can plug into my group input so selecting the from minimum i'm going to plug that into my group input and that will control the vane darkness you can see here how everything seems to be working properly and have a pretty good range of control over the overall appearance of the skin colors etc alright so say we've got a character here this is one i downloaded off of cg trader just a base mesh head say we want to add three different textures to this one character i've got a skin tone here that we just made the procedural skin tone and say i want to have like a more of a reddish cheek maybe add some lipstick or just a different lip color and maybe some veins somewhere where they're not going to appear over the whole thing you can do this with uv mapping so i'm going to add an image texture and a separate rgb node and we're going to add a texture coordinate to all those and keep it in a line here [Music] now i'm going to go into the uv editor and select the whole uv this one's already unwrapped but if you need to unwrap it you can press u and then i'll create a new uv name it head mask uv and make sure that it's a decent size 20 48 pixel is pretty good here you probably don't want any smaller than that how this is going to work is we'll go into the texture paint mode import the uv and we can use the different channels to create three different masks which is pretty ingenious essentially you'll be taking the pure red pure green and pure blue channels and painting in where you want certain materials to show up and you can adjust that here in the color picker so we'll import our uv and then we'll also go to the shader and change over the image texture to our uv now and i'm going to plug all of that directly into the material output so we can see what we're painting and i'm just going to start painting the pure red on there [Music] now i want to do just the lips here i know those are going to be a different material so i'll switch to the pure green but everything's showing up gray and the green's not showing up at all that's because i have the separate rgb node plugged in so plug in my image texture and now we can see the green and this is taking too long so now i can paint in the pure green i have the strength set pretty low so that i can blend stuff pretty easily but for the lips here i don't actually need it to be that soft so bump up the strength there and i'm not gonna worry about getting this perfect this is just to show you so now we've got the lips and we'll go ahead and select some areas where we can put in some veins with pure blue and that works for like the temples and neck uh keep in mind here also i have the mirror set up top on x coordinates so it's painting it on both sides [Music] now what i can do is i can duplicate my group node a couple times and all i have to do is adjust each one of those nodes and then i can blend them in using that uv mask so use a mix shader and plug the value of red to start into the factor of the first mix shader and so on and now we'll plug that first mix shader into the second one mix everything together and now the red channel green channel blue channels and then the final one in the string will be the final one plugged into the output they're all the same right now so it's not really going to change much here but you can see here i can go in and now adjust for say the blush area i want to change the color to be a little bit more red and we'll do the same with the sub dermis just make it a little more reddish [Music] still not too noticeable so i can make the base color just a little bit brighter and i'll also lower the roughness so that it's a little bit shinier now for the second texture we're going to try to get like kind of a natural lip color i guess so just a little bit more of a reddish tone and definitely lower the roughness so it's a little bit more shiny you can also tweak the texture to make it a little more lip like but i'm not even gonna bother right now and now i'm just like messing with the veins but they're not really coming through so i want to brighten that blue in my uv mask and i'm also noticing something else here which is probably affecting things and that is that i only have the scale set to one of these controllers so after i finish these adjustments i'm going to go through and just like plug the scale into all of them that way they all have the same scale [Music] and now i can kind of see that those veins popping through which is what i was trying to go for with this final material here i can dial it down a little bit and there it is [Music] so i did a quick cleanup uh on the rgb mask or the uv mask here and now i'm ready to bake out these textures i'm gonna go one by one isolating the necessary elements to bake to separate uv images in this instance i'd like to have diffuse roughness subsurface color and a bump texture since all of those are currently edited in the rgb or the uv mask i use those terms interchangeably i'll start by creating a new uv map and the uv editor you can sometimes find the tab up top right now it's down at the bottom which always throws me for a loop anyway when creating a new uv i want one that is 2048 my 2048 pixels and a 32-bit float i don't need the alpha channel here now i'll jump back into the shader editor since all three of these group controllers modify the same node tree i can jump into any one of them with this little button and simply grab the diffuse socket and plug it into the group output [Music] you can see that this will give me the basic diffuse colors from the emission of the shader at a value of one next i'll add an image texture there's no need to connect it to anything just let it float there i'll simply use the drop down here to select the uv map that was just created now i can switch over to cycles [Music] now i can scroll down to the bake section and select emit from the drop down and lower my render samples if necessary which i do recommend doing it significantly speeds up the process by default they're set super high so i've lowered my render samples to 12. as long as i've selected the new image texture in the shader editor and the object is selected in the viewport i can press bake this will quickly render the emission data to the uv map i created i can now save it and repeat the steps i have a tendency to save as png by default but it's always better to save as exr while rendering the subsurface map i noticed a discrepancy with the vein mask and realized i needed to further tweak the map range node to properly mask the veins because it wasn't properly masking the veins as is so here are the new settings [Music] [Music] when creating a uv map for the bump here i notice it is especially important to use a larger image so i'm doubling the size to 4096 pixels also it's especially important to save this image as exr to preserve the negative values anyway also keep in mind you need to bypass the bump node when plugging this branch into the group output you add a new bump node to the final baked result later [Music] now that the textures are all exported i can switch back to evie and create a new texture and rename it [Music] i'll plug all the big textures into their respective nodes and i'll start with the diffuse and speed through the rest [Music] once i get to the bump i can plug that into the height of a new bump node i remember the previous settings from the procedural texture so i can just plug those in and i can still dial these in a bit if i want to [Music] i can also slightly manipulate some other things like diffuse using color nodes such as contrast i'm limited with what i can control since the data is baked in but there is still a little room to play around with the settings here if i want to [Music] so there it is a really versatile procedural skin setup that works pretty well in eevee this workflow provides a lot of control and you only need to build it once then you can append it into any project you want and get cooking i know i moved through everything really quickly here so i'm just gonna share a few helpful tutorials in the bio that do a better job of explaining some of the processes here i'm definitely no expert i just thought this was a useful setup that i wanted to share and i really hope it can help others make some really cool stuff in blender thanks so much for watching take care
Info
Channel: LAZERS LAB
Views: 24,122
Rating: undefined out of 5
Keywords:
Id: VTQvg8dqkto
Channel Id: undefined
Length: 25min 31sec (1531 seconds)
Published: Sat May 21 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.