Moss Material Layer - Tutorial (Unreal Engine 4)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi and welcome my name is Lucas Scott's I'm one of the artists he had mind games interactive feel free to check out our website if you're interested in what we're working on and today we have another video tutorial for you guys this one was highly requested and it's about the most effect on these rocks so first let's take a look at what we're talking about here on these rocks we can see they all have a most layer these are multiple instances multiple instances of the same mesh and if we move them we see that the rock that the mass is actually word aligned also if you rotate them it's always on top since its world aligned it blends really well with the other rocks so this is a really fast way of just patching them in together and then fitting with each on state or that instantly and it gets rid of a ton of seams and stuff and just makes them blend really well also we have a bunch of options in the material instance let's open that up let me bring the lower what some a second screen let's take a look at the options so most of these we can ignore because of course this is a material setup for our whole for a whole scanned asset pipeline so we're not going to take a look at all of them what we're going to take a look at is the world line blend because that in this case is our moss and what we have we have tiling of the moss of course I put a higher value in here it gets way less it gets less tired so let's put this back to 20 and then we have or maybe let's try something like 15 that looks kind of nice gives it a little bit more structure and then we have the opacity it's really clear if it's at zero you can see it so this is what this would actually look like without the moss it's not it's nice I'd say like this this looks pretty bad actually and now it looks awesome so this I don't know I really like this effect to give some nice plain areas kind of some takes away the noise makes them blend anyway let's move on we have to world blend Max and that's really cool so if I put a serum it's actually gone and now if I increase this let me do this this way it looks cooler we can see the moss grow from the top all the way until they're completely covered in moss I think that's really cool and this doesn't just this doesn't just used to geometry this obviously uses to know a map so all these red areas that's actually part of the mas trader because muscles in just a green part it actually kind of mystical rates around the green part and kind of a reddish way so that's also we're going to something we're going to take a look at so increasing that increases this effect and puts it on normal map on all the little cracks and stuff just gives it a really really cool effect also this what I talked about the normal map we can actually disable that increase it so if we don't want the noise from normal we can get rid of it I really like it so leave it in there and then for this most edge guard is red you can actually change the colors if you want crazy blue or wherever we can always suit it on some bright red it looks really bad right this is meant to be a color like this but look at the point and then of course you can always set opacity something we'd like I like the whole fact that's all the parameters we have for this now let's take a look at the actual material closest so this is the material don't be intimidated this once again is a whole scan desert master material so all of this you're just going to ignore the only part we are interested in it's Tomas blend down here so it's it really isn't that bad however there is a material function in here which is where the actual blend happens and that's one weekend what we're going to take a look at first so just to give you a quick overview of what's happening you of course two sets of basic materials so I expect you to have a material that consists of a base color specular roughness and normal map value once you have that also if you're interested in seeing our pipeline for measures like for scan deserts which we have detailed normal mapping that fade over distance we have some adjustments to color we actually deprived from our color map or roughness on our specular to kind of keep our our textures in check so if you're interested in that just let me know so going back to our mas blend we have blend depending well we input our normal map value in you and we also or totally forget that forgot that we can paint this with vertex color and I have to enable alpha now there we go so it is zero you can actually remove the moss like if we don't want it in a specific spot but we would like to affect the wall we can just remove it this way that's what's happening down here and then we have the most material itself and then we have the blend under stone here's to miss coloration so let's go through the step-by-step so let's create a folder you call this most tutorial just a fold away we're going to store all of our stuff and in here let's create a material function so materials and textures material function and let's call this Moss MF for material function actually I'm sorry it's supposed to be a material layer so ml so you have source control enabled so it kind of gets this weird power-ups just so you don't wonder what's going on so having this opened up looks like this and now let's bring in some textures because of course we need textures for this to work so I have a most section right here I'm going to use so let's group and actually it's a texture sample now that's not what we want we want and texture object so let's convert it that's our texture object and what we're going to do with this we want this to be word line so we're just going to use the word aligned texture node this one and what we need for this is an input for the texture size so let's create a scalar by pressing and holding one on the key on the keyboard not console there we go I've there you go and let's use a value of 1024 let's put that into our texture size and of course we need a word position because we want this texture to be a world line right we want us to always be applied in the correct way to our mesh so what we're going to do is we're going to get our absolute word position such forward to find is not and we're going to multiply that we got a model ship by a well we actually want to multiply it by a scalar value this is going to be defined our tiling so how much the material is tiled but since this is a material function we can just convert this to a parameter and we want to change this later on so let's do a right-click and search for an input function input and this can be scalar this is just a what is stress or tiling right and in the X we're going to input our scaling value let's put in something like 10 you can always change this later and let's use the private value as default so it doesn't throw any errors if we don't have anything connected we can use this as our word position so and that's actually already our result so what I like to use is the XYZ texture because if we just use the Z texture or XY what we're going to end up with is a most doesn't blend well from the sides but only blends well from the top or one specific side and when we use this one it actually it's almost like free planar blending it isn't completely but it gets close so it looks really good at a lot of different angles like if there's really steep differences right around the edge or something where we can find something around here this actually looks pretty good from all angles that we oh we don't have an instruction got them we don't have any stretching so I can show it but there are there are special cases where some stretching is going to occur but for the most part we find with us so if we if we actually just preview this we can see what's going on luxury it looks pretty good already however what I find is that getting rid of let me just paint in my mouth again so I can actually show what I want to show here we go small like it so what I find is that mass has this kind of it's it's almost glowing it's really fuzzy right it has this nice like like this first layer and so of course we're going to use the fuzzy shading node you and actually if you're missing these world align texture and fuzzy shading notes and I'm really sorry and then I took them from one of the epic example projects and I totally forgot about it I just noticed that it on categories so this could be the case please let me know in the comments if you can't find them in your if you do a right-click and search for them and I will add annotations on how to find them there in one of the example project from epic sodium free to use and they're available through the launcher so we can get them that way just let me know and I'm going to search for them and I'm going to let you know where to find them anyway going back to this we're gonna put our XYZ texture into the base color of our fuzzy shading and that's actually no let's let's let's put some some values in here especially for our normal map so that we have a value for a normal map of course we need to have a normal map so I'm going to take Naama that I have for my Moss put this in here once again I'm going to convert this to a extra object this is important because we're using the word aligned texture node and it only takes texture objects it doesn't take any texture symbols put it into the texture once again exercise position ready to go and actually we don't need a word align texture note sorry what we want is a world line normal there's a difference so if we look into these they do some different stuff so I'm not going to go over because it's complicated so this is let's use this one it has the exact same inputs on this one word positions down here so we go and we also have to decide whether or not we want us to be in world space so let's create a static bool and false is okay for us don't want us know not to be in world space we want it to be in tengan space because it's cutting apply to our mesh now once again we're going to use the XYZ texture and we're going to use this for our normal map input and the fuzzy shading now we do have values here for core darkness power and edge brightness if you want to you can totally play with them you can create inputs just like this one and use them in here I find that these values are totally fine for most so I'm just going to leave them the way they are so at this point you can create a make material attributes nodes let's put the fuzzy shading into our base color and also let's put this normal map right into our normal map slot once again the XYZ texture right into the normal map slot let's put this attributes into our output so moving on actually applied us and say that so that we don't lose our work you you now this would actually already look fine if you just put default values into specular and roughness or what I like to do is I like to give some break up into the specular on roughness even of the moss to get some like this nice highlights and darker areas in here so what I'm gonna do is I'm gonna move the normal map all the way down here and actually comment this pressing on the keyboard put in normal this part up here I'm going to comment color move this up a bit because we're going to need some space in here I take this Xyz texture value from the default color and break out float free components this gives me back the red green and blue channel what I want to do now is use the red channel and deprive some specular and some roughness values from it so what I'm going to do first for the specular so I'm going to increase the power and what I'm going to use for that is a a constant and well actually we could use an input and I guess we could cut we get them and I already know for my extra that a value of one so basic not changing anything on the power works fine wherever your texture the wrestled may differ so you want to create this into an input parameter and change it later on so you can actually see what it looks like when you have it apply to your game when you have it apply to your mesh and I'm sorry and what we have to do then is clamp this value so it's a zero in a range from one from zero to one and what I'd like to do here is limit the Max 0.5 so this way our a specular never goes above 0.5 which is kind of the default value for this material but you can go below so we get some dark areas in there and then let's plug it into our specular that's basically all comment this so spec has some small break up if you look at this actually preview it if some nice back break up for specular with some darker areas now what for the roughness is kind of really similar it's really similar this actually this works for a lot of materials for the most part just for natural materials be careful with the specular because can it can look really bad but I like to do is for vegetation moss and stuff like that but a roughness we're going to use a cheap contrast you and we're going to use a scalar parameter of 0.1 and once again if these parameters ones regular if these parameters aren't working for you you can always change these like these are kind of dependent on your texture this is kind of like you can also do this stuff in Photoshop if you want to I just like to do it this way because I can well I'd only need a base texture and in normal map you could always create these speculum roughness maps in Photoshop and then just import them or you can do it this way and kind of like these these values adjusting them is kind of the same thing you would do in Photoshop with blend layers and stuff like that right so that's a little bit of tweaking involved in here to get a nice result then I'm going to clamp the Sheep contrast and I'm going to use this as an alpha for alert because I like to use this what we have here kind of like an alpha for two different values they're going to define my roughness and for the roughness of the most I found that something between 1 and 0.5 works pretty well so if I preview this it's kind of like a it's a really rough material right and it's kind of exactly what I want so let's put that into our roughness where is it there it is it's commented so once again just to break down what I'm doing here and basically creating a a mask and alpha for these two values that actually define my roughness so I'm using the rub to use this alpha to blend between these two values and this way I'm getting my roughness and for the specular well I guess I could do the same thing I just used this as a as a base point for a clamp so I'm just I'm basically using a very similar alpha to this one down here and I'm just using a space from 0 to 0.5 and I just clamp everything above that because I don't want any crazy specular values like 1 or even something bit above that that would give crazy clear and stuff like that that's all we're doing here that's actually it's it's done should be done let's look at this if it looks good then we're ready to go keep going there we go now we have this this nice fast right because we have the fast applied over here and roughness looks good surging looks nice cool let's life saved us and now we're ready to apply this or master material going back to the master material there's a bunch of stuff in here that's not really important for us so that's everything we have here so what I'm going to do is I'm going to move this over here and I'm going to lead you step-by-step through what we have created here in a different material that's much more simple so for this different material let's create a new material or maybe you already have a material that you just want to layer the moss on top then you can use that I'm just going to create one and call this rock land I don't know just make it up open this and now we have our material and now we need to set up a basic material and it's going to be really basic let's go in here one of my rocks let's just grab these textures I'm going to take the others this looks fine let's try can drop them in here and really quickly set up a basic mature we don't want to wrestle yet so we're just going to plug this into a make material attributes node so we have a base color give him a normal map so need some some values for roughness let's put the set point eight or something for rock I guess maybe even higher I put this at point nine it's really rough rock I don't know 8.5 something between don't have metal expected as a rock so that's actually all we need so super basic material might end up looking horrible but whatever this isn't really important the important part comes right now because we want to blend our most layer on top of here so let's go back to our most layer I should let us just find it in the content browser and drag and drop this material function that we created in our rug and this is what we get get our most material layer as one in the so Thailand actually we haven't named this so if you want to serve a proper name go to input in scalar and give it a proper name on the neck tiling so let's create a scalar parameter plug it in here do the tiling of 10 if you convert this to a parameter call it tiling so now we can into matured instance for this material control over tiling and we have our most layer now we're going to blend this on top of our other material so let's use a matte layer blend and we want the default standard one so where is it standard material layer blend standard use this is the top layer and of course we need an alpha and that's where it get we get the real fun because this is very used to normal map from our material over here so you can just use group this one and use it for alert let's put this one where we're going to put this up here we have to slur and we're going to input this into the B value and into the a and a value we're going to put a three vectors let's create a free vector by pressing and holding free on the keyboard and clicking and let's give it a value of 0 0 and 1 this is going to be our a so the reason I create this this is a but this is a basic mole map I guess and we're going to learn between these depending on their on the blend normal so under an a parameter that we're going to create so let's create this parameter let's call it blend normal and what's this is going to cause is this is this parameter that we can use let me show you this blend normal material blend normal parameter that kind of makes it blend depending on the normal map right so that's what we're doing right now it's this parameter and let's put it to one default because it's a nice effect and why wouldn't you have it was always nice to have control over so what we're going to do with this value is we're going to use a transform vector node you and because we want to which one is this transform we want to get this tangent space normal that we that we have from up here and convert it into world space because of course we want this most be layered on top of the mesh not just apply to the normal map in a weird way so we convert to standard space to world space we'll transform vector once again it's a right-click and then it's transform and form onto vector ops transform so you get this node let's normalize this and now we want to get a dot product between this and our normal value from over you let's use the constant by a scalar and result from this it's prevalent so this has turned after normalization that's what it looks like kind of a well like a well the line normal map right you can see the colors on the sides and using the dot product and the constant bias scale gives us like a a gradient gradient on where we want to apply our Moss so we're going to use this to learn the values we're going to load between so this is an alpha for the slur let's create create two constants but this won't add minus form and let's convert this onto a parameter call it the world land max let's put in a value of two or something now these two values you're going to have to play with them once again this is kind of like using layers and Photoshop I use this value to kind of define how much of the moss gets blended always easier to show this but down here so we have to word plant max at zero there's nothing at one just a little bit to this a little bit more you see this is this really nice effect that gives us a lot of control over how we want to blend this something like to works nice so this is this value right here and once again you might have to play with this different value that we want to lower between and now we need to clamp this value because we want to have this in a value between 0 and 1 and not something crazy like this might give us values above 1 or 0 so we're just going to clamp those and what I like to do them create a node alert and lower between 0 and this value and I like to blend between them with the vertex color because this using the alpha or whatever you like gives us the option to paint out parts of this Moss so this is if you go in here and paint it with vertex color right we can remove most from it that's how we get that now well one more note we're going to use a multiply and in this multiply we get another scalar value defaulted one convert our parameter and this is the most so pasady so most positive and this is the Alpha we're going to use over here it's why listen and this one we come just taking our material we can use material attributes and plug it right in here now if you stopped reviewing this value which should see the most on or rock so and of course only on top of it so you kind of have to use the preview like the little sphere it's going to look rock and there we see this looks really really nice with the moss on top down here it fades out and it disappears completely this is what we want and let's just apply this so that we can actually look at it in a mesh in our report I'm going to quickly search for the mesh that is using these textures or it's going to look really what wrong or actually I think you might have used to correct one anyway like let's let me try to select all of these and apply it to them drastic it's the exact same thing cool so I just add a rock switch to material apply to them and they look almost the way they did before the only thing still missing is this this red line this red detail around the edge of the moss and I've actually decided to move this to a different tutor because I noticed and I wasn't aware of that that I used a custom material laying note we bring over my scan desert master material which is already applied I use a custom note called mask edge for this that I've created and this actually is a bit more complicated and I'm going to show you how to do this in the next tutorial or just let me know if you interest in I can send our screen shows or I guess you can actually take a look at it now that's all it is right here so if you're really interested you can just build it and from this information otherwise I can create another tutorial for it let me know in the comments if you're interested in this red edge color and besides that this effect is already really cool like this is the really important effect of it and this video is going on for a while so I'm going to end it right here like and subscribe if you liked the video and if you're interested in more Tudor like this also let me know if there are any other tutorials you're interested in also stay tuned for our game same because we just we're crunching on the first final art for one of your environments right now so we're going to be able to share something on that really soon like end of this month soon or actually it's still December right at the end of next month I'm sorry end of January and yeah looking really forward to sharing more of that with you and check out our Twitter if you haven't like we're going to share stuff there we're going to give updates and when we're going to release to toriel's and yeah I see you on the next row have fun creating the shader and bye bye [Music] you you
Info
Channel: Lukas Kölz
Views: 86,174
Rating: undefined out of 5
Keywords: Unreal Engine, tutorial, Material, Moss, Gamedev
Id: HDluA1f5gzw
Channel Id: undefined
Length: 33min 30sec (2010 seconds)
Published: Fri Dec 30 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.