Unreal Engine 5 Beginner Materials Tutorial - A Complete Guide in UE5

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
learning to make great games is hard as hell learn with us at unfgames.com to make it easier if you are learning a real engine 5 and want to learn more about materials then this video is for you did you know that 70 of the visual quality of your game depends on the materials and textures you use knowing how to create your own materials will help you to increase the quality of your game environments and scenes i will take you from an absolute beginner to a person who can do the most important operations with materials inside unreal engine 5. we will go through the very basics like showing you the most common operations and apply those to create your first master material then we will learn about material layers a powerful toolset that not many people use so you can easily create complex materials and reuse them in different projects we will learn how to create functions from the most common operations like changing colors normal maps slope masking vertex painting and adding puddles by the end of this course you will be confident to create and modify materials for your environments the master material used in this course is available to download for free make it the description below so before creating any material i need to show you what the material is so what a material is is basically a paint you apply to a 3d model okay it's just basically that it's like the color and everything and how it looks so for example you have this wall and if i check the properties you will see that i have one material here if you don't see the properties press f4 it's also in the details panel and you will see that it's using one material it's like a paint wall okay so one material can be applied to one model but also you can have cases like this for example this chair where is using the metal and the painting and you will think that it will have two materials but when i click on this it actually has one and the reason is we can do operations inside the materials that help us to decide where we want to apply the painting in our models for example this part can be metal and this part can be the the other painting material okay another thing you can do is to actually apply multiple materials for mesh for example here you have two materials you have the darker one and the brighter one okay and i will show you when to use bottom methods okay and another thing that is very useful with materials is that you can have like several instances if you like this model i put a link in the description but basically this knight has a lot of material instances like if i click on this you will see that i have a lot of this okay if i double click on one of those you will see that i have a parameter window let me move this here and just to show this out you can change different things like the roughness and we will talk more about it in the future we can change the color something like this for example i don't recommend you to put something like this but you can basically do any kind of material manipulation within a real engine and this gives you a very flexible workflow where you can use create multiple meshes that use multiple materials and you can have a very rich environment so let's start by creating your first material so let's create our first material we need to open the content drawer with control spacebar or you can go to window and then content browser you can choose one of those here either way you can just right click here and then create a material usually for convention you will use use m underscore and the name of your material let's just call it our material practice something like that okay and then we will just double click on this now what we have here it's a window very similar to blueprints if you have used it before if not i will show you what you can do with this it's basically a graph window in here you can see if you rotate with the mouse with the left mouse click you you will see that you can preview your material how it looks like right now it looks like black and have no properties because we haven't plugged anything okay the left one is the details panel okay this will change depending on which node we are having but if you don't click on anything or you just click here you will see the material properties for uh the over up material properties and the right side is your outputs so you have the base color which is the color of your material the metallic which is a value between zero one which will determine if it's metallic or not the specular value the roughness which is how shiny it can be the emissive color okay and the normal one and the ambient occlusion these are these are one the the most important ones okay so if you right click here you will pan around you can scroll up and down okay to zoom in and out okay and that's basically it okay so how you can start creating something okay you can either press here click the palette and you will see that you have a lot of notes okay and that can be very overwhelming at the beginning so here you have a search tab okay so i will show you which one are the most common ones let's create a constant okay you can see here that you have constants like one two three and four okay these are vectors okay let's create a constant one for example you can just drag this here okay we can go here and drag another one okay and do the same here for the third and then the fourth there you go now there is another way to create which is using the tap button with the tab you can just type here now you can just type constant and you can use with the arrow keys you can select which node you want for example you want this one and just like that you can just create any node you want okay so the constant ones are very important these are the most basic ones that we will use for operations okay so what happens if you put this one here let's put the constant one in the base color you can basically drag this here and plug this here and you will see that nothing has happened okay but what you can actually do is go here and you will see that when i click on a node i will see the parameter here is change so i can just type something like for example 0.5 and you will see that it has become brighter or i can just use that right left mouse click to make it brighter and i can just do something like this for example okay and i can make it darker and that's basically what you can do the constant is a value between 0 and one well it can be any value but where zero is the black value and one is the white value okay now if you click on this you will see that you have three values okay so the three values here if you click here this arrow you will see a bunch of properties here you will see that you can change individually each value for example you can change the red one you can change the green one you can change the blue one and then you can control this okay now there is another way to change the color here and that is to click here and here you will be able to change the color here for example this one click ok and then you will have your blue one or you can choose another color if you want okay you can also save colors here drag and drop colors here to say for example you want to save this color you can just put it here click ok and now when you let's you change the color i i want to use this you just click on this one and this will be safe on all your project okay so this can be very useful okay so this is the most basic way we can create materials now here the material is not applied anywhere so you need to click on apply okay and let me move this window here and what we will do is go to our map and go here and let's create a basic shape like a cube okay we can create a cube press f to focus and we can just go to the content browser and drag this thing here and there you go now we have our material if i make any change here for example i change the color to this one okay you will see that here it's still growing and the reason is you haven't applied the changes okay so you need to hit apply for any change you do in your material so then it will load again and there you will have your new color so the next thing we're gonna do is to take a look at what else we can do with the material so let's add more features to our material what i want to do is to add something in the roughness to change how glossy this material is okay because right now it's very rough and i want to change the the roughness of it so i can either go tab and type constant but i will do something different now i will show you a quicker way to create notes and that is by holding the one click two three and four to create a constant one two three or four vector that's the way i do it and i highly recommend you to remember this hotkeys okay if you can just put one two three okay you can just create any note i will leave a link in the description with a lot of hotkeys that the most important ones okay but for now i will show you the most important ones as we go okay so i will press 1 to create a constant and i will just plug it in here the roughness okay as you can see it becomes very glossy okay and i can see the reflection of my environment and that's great it glossy glossy materials are really cool so you can change this as i increase this if i put the values of one it will be the complete opposite is completely rough like very very rough or you can put something like in the middle 0.5 a little bit glossy or maybe something like 0.3 something like that you can just play with the gloss in it here okay so basically materials can be very rough let me delete this we don't need this anymore materials can be very rough or very glossy or somewhat somewhat in between okay so that's what the roughness does the the metallic on the other hand i press one again i can just click here and if i want a surface to be metal i can just change this to one okay and now you will see that i have a metal surface okay and if i want like a mirror type of surface i can decrease the roughness to make it very smooth but you will see that i have the sphere is very reflective it's like a metal if i click apply you will see that my cube also does the same here okay so this thing roughness and metallic it's called the pvr the pbr stands for physically base rendering okay which is a render based on the physical properties which is the metalness and the roughness now you can play with these three values and have a lot of variations okay so you can have like metal you can have like rock you can have like plaster plastic brick walls whatever and all of them will have different properties okay you don't need to be exact on the properties you can just put what you feel like it looks good for you for example i can put 0.3 here and technically this is not physically correct you cannot it's not that you cannot you can have like values between zero and one for the metallic but it's not physically accurate what is recommended is either zero for non-metallic surface or one for metallic surfaces okay there are some cases that you will want to play in between values but most of the cases is either zero or one whereas roughness you want to play with this because there are very different values here that you can play from zero to one okay now let's continue and let's see what other common operations we can do in the material to make this material look much more interesting so let's see the most common operations you can do in materials and that is you know basic math so here um i can just modify this color by adding subtracting multiplying or dividing that's the most common operations i'm sure you have seen them in school so you can also do it here so you can right click or press tab and click add okay and you will have your add button you can also press a if you want okay a is for this okay you can go for multiply okay you can which is m for multiply you can press d for divide okay you can just click here divide and you can really type subtract so subtract there you go okay and that one i'm not saying i don't remember the hotkey remember i will leave a link in the description with all the hotkeys for this one okay so these are the most common operations so if you want to add value at this take a look at for brightness okay brightness will come like it will add value okay if i add this here you will see that everything turns brighter okay and i click here and you will see that i have two inputs here i have the first one which is using this color and i'm using the second one which is using this number okay i can create one with pressing one i can add zero and if you add zero to this then it won't change at all okay let me change this to a color where it's not using any color here let's put something like 0.5 okay now as as i increase this you will see that it becomes brighter and brighter and brighter okay so i can also go negative here okay and i will make it darker okay until the point where it comes completely dark okay so this is the add operation add and subtract basically do the same okay so if you want to go here connect this to and connect it here you can play with a subtract for example if you put 0 you won't subtract anything but if you put something like 0.5 it will turn dark okay so it's basically these two are opposites and usually you can play with only one of those okay and you can just change this value either negative or positive now let's delete this let's just move it here we don't really want to delete them press alt and click to remove the the wires okay let's put the substrate here i will put all this here so it can be like a little bit organized remember this is for learning purposes the next one is multiply so i can multiply this and multiply you can think of it as intensity okay so for intensity it will make it everything look brighter or everything look darker okay so the same with divide is just that is doing the opposite so for example if i press one nothing will change because as you know everything multiplied by one is just one if i put something like two i will make it brighter if i put something like five i will make it brighter and brighter but if i put something like 0.2 for example i will make it darker so this is multiply is like a intensity note for this okay and the divide just do the same i can just go here and connect this to and put the divide here and if i divide by one nothing will change but if i divide by 1.5 for example or two it will become darker and darker okay and it's basically a little bit different okay i can just put something like 10 and become very dark okay and i can just divide by 0.1 and it will come brighter okay so these are the four most basic operations math operations that you can use there is another one that is the power node uh i will show you that in the future but for now you can just come here and even combine those for example you can add here and you can multiply here let's create another one so for example you can add something like 0.2 to make it brighter and then you multiply by one nothing will change but if you multiply by 0.4 it will make it darker and you put 0.1 you will be even darker and you can keep combining those until you have the operation you want okay typically i use this ad for adding brightness and then i use the multiply to change the intensity of the color okay so just by doing that you can do the same here and here to change the roughness and the metallic if you want it so let's take a look at what else you can do with materials so what if you want to do something more complex than a solid color this is where you will need a texture okay so if i go to my content browser you will see that i have my starter content folder if you don't have it you can go to add then go to add feature content pack and here you will click on content click on starter content and add to project okay i already have it so i don't need to add it but if you want to use like some textures and some materials here you can just go to the texture tab and you will see that i have you know textures now let's see what a texture is composed of remember that here i had three channels the red the green and the blue one i can also have the three channels also a fourth one here where i can combine these colors okay to create that the image that you have here and i can just click here to isolate each channel for example if i want to see the red one the red one looks like this if i want to see the green one it looks like this and if i want to see the blues it looks like this and when i combine all of those i get these colors the red the green and the blue which is basically what i had here but a little bit more detail so what i can do is choose any one of those textures for example okay let me choose this one let's choose the bricks and let's just drag it here and put it here okay i can also type here texture sample okay and you will see that you have a bunch of options if you click here you already have the texture here and the reason is i have click here i already have selected this okay so if i wanted to select another texture for example i want to select this mask i can go here and use click that arrow here okay and if i want to create a new one i can use click here i can drag and drop like i did before or i can just right click and put texture coordinate sorry texture sample okay and i will have my normal map okay which you will see in a second what it does let's disconnect this for a moment without i will just leave it here so it can be a little bit organized and let's connect this okay let's let's remove this we don't really need this okay let's connect the base color here and you will see that now i have the color information that i have in my texture if i double click on this you will see that i have my base color here okay the red the green and the blue each one with different values you can create a texture like this okay this is a mask we will take a look at the mask later but this is a normal map okay so a normal map when you plug it into the normal channel you will see that my texture now is having like a little bit of a bump here and this help us to add more detail by faking 3d geometry it's basically a lining information texture if i double click on this you will think that the normal normal map really doesn't have uh you cannot read this information right so what you can have actually is the red channel is it's a little bit hard to see because the blue one is choosing here we can just click on this there you go we can click on the blue one just for a moment remember this one need to be placed on on normal map okay we will change it later the the red one okay the light is coming from the right okay the light is coming from here okay and this is the information you have the green one and that's basically the two information you need the green and the red the light is coming from here okay so you have one that comes from x axis from here it's very easy to when you isolate this and one comes from the green axis and the blue one it's basically uh let's just call it a z depth okay we don't really need it but you know it's there okay you we can control c to change the compression settings from default to normal map okay this will help us to compress the texture as a normal map and there you go okay so that's basically the textures how you can manipulate it let's see what you can do with this okay so let's look at what is masking masking is the ability to use some areas of the textures and manipulate them to have a different result now if you want to put some roughness here for example you want to put zero here okay and make everything shiny uh you can do that if you want like a shiny brick we can put 0.7 right um it's not gonna be very um very pretty okay so what you can do here is go here and you will see that you have a strange texture and when you have something like this it is better to remove this so you can take a look at what your what you are seeing first is the red channel and the red channel looks like it's the roughness okay it can be anything you want actually can be used for color variation a lot of things but basically it is the roughness the green channel it's the ambient occlusion i've seen this multiple times i'm sure it's ambient occlusion how do i know basically you have that contact shadows when things are getting close okay and the blue channel is basically the right one it's the same so you really are manipulating two channels here when you're working with mask what you can do you must do is to change this default value to mask okay and look like nothing has happened but actually what it actually did was uncheck this srgb what this check does is they try to calibrate the colors because each monitor will look different for example here if we take a look at our color texture here you will see that my colors are like you know with srgb and the reason is every monitor will have different calibration settings and you want your texture to look more like the same across multiple monitors but for a mass texture this is used under the hood you don't really need to see it the monitor won't you won't need to change it so if you don't click on this you will have different values for different monitors and this will be a big trouble because it will change the roughness of your material depending on which computer you use it and you don't want to do that so make sure you to change this to mask or to srgb off okay that's the first thing and once you do that make sure here you also change to mask okay click apply and now that you have this you can use the red channel which was my roughness and put it here and you can use the green channel and put it here there you go now we have all our three textures working correctly and if i can take a look at this you have a really nice texture that you have applied and you can apply this texture to anywhere for example i can come back here i can grab my material and put it here and there you go now i have my material here awesome okay so the next thing we will do is to see ways we can modify this texture using some of the most common basic operations here okay so we have our brick material and let's do some modification to this sometimes you want to change the color and things like that so let's see what we can do with this let me close this by using the middle mouse button go here to the material and like usual we're going to use the multiply node okay so let's just hit m for multiply and here you can just press 3 to add a color and let's just put something like red for example or orange let's multiply this two put it here let's see what happens now everything turned orange okay so how can you change this there are several ways we can do that but what i want to show you is the concept of lurping so if i open up this texture here you will see that i have an alpha channel how do i know this because you can see a checker board here okay so if i click this i disable the rest of the channels and i will have something like this this is my alpha channel okay so what i will do is to use this mask to tell the material only apply orange in the white or the black areas so let's do that how can we do this well or do this in order to do this we need to alert node and we do this by linear linear interpolate okay so you can also press l if you want to have it okay let me delete this now the alpha is the mask that you will have here okay and remember that this alpha here has a white value and a black value that white value will be on the b okay and the black value will be on the a okay so let's just say i want the yellow color on the white values i can just come here the original color will be plugged into a the orange color will plug into b and then i will plug this into the base color right so now that i have this i have my bricks are getting orange here awesome let's apply this to take a look at how it looks in our level and there you go now we have applied an orange brick to our texture awesome so what else can we do well we do have something here remember our mask we have a roughness okay what we can do is to increase or decrease the power of these values here and we're doing that by creating a power node which is our next math operation i want to show you okay so let's delete this we don't really need this for now what i want to do is to drag this and type power okay now this would be very simple let me put this to one first and if you want to take a look at how this looks like you can just right click on this and start previewing note okay so this is what the texture looks like let's put something like this this is what the texture looks like when it's only the power of one if we put two you will see that the darker values become darker and the wider values become wider let's put three let's put something like five let's put something like 10 15 50. okay so if you do like 50 that's a lot of contrast if you put 20 if you put maybe 15 then you have like a mask here you can use okay now this thing here what you can do is actually use one of this mask to paint the bricks and this is where we will introduce the one minus node because i want the opposite of this mass so what i can do actually the power is used type power here i'm not sure if i press p or something like this but you use type one minus okay and if i connect this you won't see any change because i'm previewing this node but as i right click start previewing note you will see that i have something like this okay now let's change the contrast let's put something like 10 or 5 or 2. something like this okay or maybe maybe just let's just keep it at ten and now that you have this you actually create the same mask you had here so even if you don't have this what you can do is use this one to create a mask you can do this by putting like 15 or something or 30 or 50 something like this and you can just plug this here okay let's take a look and now you can see that my bricks i have white paint in the bottom and one white paint in the top okay i can also plug this here and it will be the opposite because i'm not using the one minus i will have the paint in the other side okay so you can manipulate texture by using the power node it's a very interesting node that you can use let's just leave this one here we don't really need to use the power node for now and what we can do is to actually change the color of this one by using another layer by pressing l i can just plug this into the a and the b will be another color okay so let's let's move this out okay we don't really need this anymore let me ctrl c and ctrl v this one okay and i will put something like blue and i will multiply this here and now that i have this what i can do is to plug this here and the alpha will be this one but it will be 1 minus if i take a look at this alpha you will see that i have it like this okay so let's just take a look at how it looks like let's just put it here and let's see how our brick looks like now awesome now we have control over the blue side of the bricks and the orange side of the bricks and we can control them by using lerps you can basically create any kind of variation you want okay okay so now that we have the color working let's just plug this in because i want to show you how it looks with the normal map only so if you check the normal map you will see that we have two channels like we saw before three actually the blue one is in the z axis the red one in the x and the y axis in the green channel so if you want to increase the normal intensity you need to isolate these channels and this is how we're gonna do it we're going to use the component mask okay this press tab component component mask and when you click here you can just drag this out and you will choose which channels you're going to use right click start previewing note and you will see that you have your normal map here okay you have the red and the green channel what you can do is increase the intensity of this by multiplying by pressing m remember and multiply with m or just type multiply and then just press one to create a constant and then just plug this here let's just put one and then right click and preview note okay nothing has changed but as i increase this for example something like five you will see that it's much more intense okay it's like one five one five there you go so what we want to do is we cannot just plug this in because the normal map needs three channels so what we're going to do is i'm going to introduce you to the append nodes so let's go here and type append and what this will do is combine two vectors here you have the first two channels and then we just need the third channel here there you go and just like that we can start previewing this note and now we have our normal map if i increase the intensity of this you will see that also the normal map increase that intensity and the same way i can just put this to zero and you will see that i have now basically no normal map okay so i can just plug this here okay and stop previewing the note and it will be very evident when you see that i can just put something like five you will see that the normal detail it's a much more intense than before you can see it here like it's very very intense i can even exaggerate this a little bit let me put something like 10 apply and you will see here that it's very very intense okay sometimes you want to have this sometimes you don't but it's a really nice feature to be able to control the normal map based on what you would like your mesh to look like okay so with the knowledge we have now let's start creating our master material i'm going to delete these notes because honestly i don't feel any all the texture will have an alpha channel and i want to make it as modular as possible so i will just delete all this okay i will have my clean base color and a basic setup i like to use is the add for brightness to control the brightness of the texture i can just plug this in here okay and you see that by default one it's too much so i will change this by pressing one i will create a constant you can just remember constant here you can create different constants okay and what i will do is to create a material instance so you can take a look at how it's gonna look okay so let's apply this and save and let's go to the content browser here let's remove this filter there you go and to create a material instance it's very simple you just need to right click and then create material instance you can type it mi and then i don't know brick something like that okay and let's just drag this here okay and we can duplicate this one too and put the master one here so we can compare the two so what we can do is to double click on this and you will see that i have a bunch of parameters it's a little bit different than material instance and why i don't see any parameter is because i haven't exposed any inside here i can convert any kind of node into a parameter okay so for example this one i can use right click and then convert parameter and this will be for example my brightness okay let's apply and now i have my brightness here so what i can do is to go here to the check if i want to modify it and i can just change the brightness like this pretty cool and it will also change the instance that i have here okay let's put another a couple of other useful notes here what i want to add is a multiply okay and i can add another constant pressing one and then right click convert to parameter and i will call this multiply sorry not multiply we will call this intensity okay then rename this to one by default okay otherwise it will be zero and if you want to connect here remember you can always right click here and connect to base color or any other kind of output okay let's choose apply and see what this node does we can change the intensity here we can just change this to a cube here there you go we can change the intensity something like this and it will become darker or brighter okay one is the default so we will just leave it like that another node that is very useful is the desaturate let's just put a desaturation there you go now desaturation will actually you know change i i will put a value of here of zero okay it will make everything dark uh black and white sorry if i put an unlead mode okay if i put one it will be desaturated if i put zero it will be it will have a little bit more color so the less the value the more color i have so i have like -10 i have a lot of color so what i will do is to put a one minus to make it a little bit more convenient okay and i will just leave it like that now this will work as saturation and i forgot i need to convert this to a parameter we will call this saturation there you go hit apply and now we go here and if we want to increase the color we can just go to saturation and increase it like something like 10 for example or 5 and you will see that i have a little bit of more color here you can see it here even easier where my color is being more saturated in the areas basically the red becomes more red the blue becomes bluer and the green becomes greener okay so now that i have this there is a problem i don't really want my values to increase over one so what i need to do is put a clamp node so just like this i i will make sure that my values stay within zero and one so i don't have any crazy value here okay and i can just go to my material instance let's just put this as a sphere change the brightness put something like zero and now this one looks a little bit better and change the saturation to two okay looks a little bit different okay great so let's continue to work on this so as we continue to work on our texture what we need to make sure is to comment on things so we can just come here and with c when you press c we you will create a comment frame and you can just put a base color something like that and with that you know that this area is used for base color you can also change the color of this one if you want i will just leave it like that but if you have many some colors can help you to organize things a little bit okay the next thing i want to change the roughness and it will be very simple i can just hit m for multiply go here and then with one i can create a constant and i can change this to roughness intensity something like this and i can just put it here and i can create another clamp node and connect this to the roughness here awesome so now my roughness it's working here okay it's very rough you can see it's uh i mean it's very glossy not rough as i increase the value something like 0.5 or one or two it becomes less and less glossy so a value of one will be like the default if you want to increase it you can just put something like crazy values like minus one or zero or one or zero point five depending on what you want okay so let's continue our normal map will have a instance too let's convert this to a normal intensity something like this and just like that we can just apply this and let's put the default value of this one to one because we don't really want to have default values that are like weird you can just go here to the material instance and we can change the normal intensity to 2 to 5 to 10 to whatever you want okay something like that for example awesome so can you just put two for example and now our normal map is stronger so now we have a small massive material we can just come here and convert this into my roughness and then this one remember with c you can comment like normal normal map okay so now that we can do what we can do is to change that texture density okay so let's do that now so a very important feature to have when you are creating materials is to be able to change the uvs so let's say you want like a you have this brick and you want to scale it okay now your bricks are very big compared to what the size of the wall is so in that case you may want to have different textile density for this object here if it's too small maybe it's right but you want to have control over how many bricks you have in your in your model so in order to do that i'm going to introduce you to the texture coordinates so here you will see that the texture sample is using uvs here so what we can do is to type texture coordinates okay and just like that we can just connect this one here and now we can change the uvs for example let's right click and start previewing this note we can change the utility to two okay and you can see that is repeating more times in the x axis something like that and you can also put three here and you have more bricks and you can go lower like 0.1 0.1 and you have like super big bricks here like maybe 0.3 and now your bricks will become bigger so what you want to do is to basically change the how many bricks you can have and we're gonna do that by using a multiply node use by leaving this at one we can just use the multiply and then go here to that create a constant with one convert parameter and we will call this tiling by default it will be one and we will plug this one here and then we will plug the multiply here and do the same here for this one and the same for this one there you go and now that we have this we can just apply and we can go to our material instance here and we can change the tiling here try to have more or less let's move the window let's close this one and you can see that my master material which doesn't have the parameters is this original and this one you can change the tiling to make it smaller or bigger you can just do this scroll down or up depending on what you want and you will have different results okay let's just leave it like two for example okay now you see that you have a lot of control over like the color the roughness the normal map just by doing this simple setup you can have a lot of variation you don't need to do anything complicated so what we will do is to add some other manipulations we can have for the textual coordinates so another thing you can do to change the texture coordinates it's to pan them you can move them around like in x or y and we can do that by pressing the add one remember with a you can create a node or just type at and you can just come here okay and just create another constant here and you can just let's just put a tiling position something like this and you can just add this one here and then control here to move all these ones here and now you will see that i can move this around so let's come back here uh let's go to our material instance and let's see what's happening so as i increase the tiling position everything is moving like in this direction you know like diagonal either here or here that's because i'm moving the x value and the y value at the same time okay so i need to isolate this so how i'm gonna do this is by using the component mask i can do the same trick i did with the normal map i can create a component mask i can put here the red i can ctrl c and ctrl v and i can press green here and connect this one and then i can put the add here and i can create a tiling i can control c and ctrl v this will be tiling x and by default will be zero we will we put it here okay and then we will put another add here and let's ctrl c and ctrl b and this will be my tiling y and we will be zero two and let's just put it here okay now i'm controlling the x and the y axis separately so what i can do to combine those is just put the append vector and i can just connect this to and with control i can just drag this here and connect this one here i don't really need this anymore so let's take a look at what's going on here let's go and let's go to the to our material instance here and let's see what the add is doing let's change the tiling to one so if i increase the x you will see that it's moving and i can also increase the tiling i increase the value and i remove let me put this one to one as i increase or decrease you can see that i'm panning around the y-axis so in in this case like for example you don't want your brick to end like this you can use move it a little bit and you can just leave it like that and now your break end ups nicely so really depends on what you want to do you can move it around if you want it's it's a useful feature to have i will just leave it at zero for now but it's really nice to have it so let's move this here okay and let's comment here on this will be my tiling setup this will be my simple tile itself there you go and now that you have this you have you have control over the tiling you have control over the color and you have control over the roughness and normal map okay so the next thing i want to do is to add another tint for my base color okay so one thing we will do before finishing up our master material is to put a color here so what i can do is to multiply this by pressing m and then click tree i can i will show you another option you can either click tree and right click and convert to parameter or you can press v and click and with this you will create another parameter okay so this will be for example my tint and we will just leave it at one okay and just like that we can just put it here and then just put it in the clamp and there you go now we our master material it's pretty much done okay let's take a look at what happens when we change that thing here we can just move it around select this we can change the color a little bit we can change the saturation what is the saturation there you go alteration you can put something like 5 or 0 or -10 if you want it to be a little bit different uh you can you can change the roughness okay you can change the tiling to two or one or whatever you can move the tiling you can do a lot of things so the next thing we will do is to show you how you can organize these parameters because now we have a lot and as you can see i'm having a little bit of a hard time finding what i want to change in the material so if you want to organize this a little better there is another way we can use in the materials we can select here one of my properties and here i can select a group for example i can change like say color something like this and now i can just go here and i can just select the color here and i can select all of those all the parameters i want and select the color group okay then i can change this to my roughness intensity for example this can be my roughness group okay for now we only have one but it's okay and here you can have the normal intensity so we can change this to normal okay great so now that we have this we can also put this in a group and call it tiling and we can apply and what we can do here now is now we have that color here the normal intensity the roughness and the titling everything nicely organized there is one more thing i want to do and let me stop previewing this note what i want to do is to convert this to a parameter so when i change the texture i can just put anything i want so let me right click here and convert parameter and this will be my base color okay i can do the same here this will be my mask and this will be right click convert parameter this will be my normal so now i can just click on all this and i can just put as a group like textures something like this i kind of click apply and now you will see that i have my textures here so now if i want another material i can just go back to my content browser look for any texture here for example like this brick and i can just plug this here plug this break here and then this mask here and then this normal here there you go and now we have another type of brick and we still have all the things that we had in our previous material we can change the the brightness make it darker or brighter change the intensity to make everything bright or dark the saturation the tint you can change the tint can make it dark too something like this you can change the tiling the normal intensity we can put it really intense or really not intense depending on what you want you can put something like two the roughness intensity we can put something like one or 1.5 something like this and the tiling we can increase the tiling or decrease it or move it around a lot of things we can do with this material so as you can see now we have our master material now uh it's quite tedious to create these things it takes some time so what we're gonna learn now is how we can create functions so we can use them in the future if we want to organize a little bit better we can create functions to reuse what we already done and use it in other materials if we wanted to do it again so let's start simple with the normal map okay so how can we convert this into a function so the first thing is we need to create a material let's save everything we need to create a material and here you will create instead of a material you will create a material function okay and we will call this mf normal intensity something like this okay so let's save everything and double click on this and you will see that it's almost the same as the material graph except here it says material function and the output it's a little bit different so what we can do is to control c and ctrl b this one okay and what we will do actually is to change this to an input okay so the input will be the normal of course and the normal intensity so how do we put this we can create an input here we can right click and search for input and we will put a function input by default this one is using a value of vector3 which is basically this one okay so we will call this our normal map okay and what we will do as you can see we can we also need information for the blue channel okay so what we can do here is to drag this and put a break float three components okay so just by doing this we are breaking all the components so what we will do is to put a mask here okay let's imagine this is our normal and here in the blue channel we will put it here now we don't really need this so we will delete okay now this is our normal map and our normal intensity will also be a input so we will create a function input but this time we're going to convert this into a scalar parameter okay and now this will be my normal intensity and just like this i can just move this around i can delete this if i want and then just put it here okay and i can have the preview value as default but let's see later how it looks like okay let's connect this one here and let's change the name for new normal map something like that okay let's hit apply and let's try to find it if we right click we can put normal intensity you won't be able to find it and the reason is we have an exposed to the library you can just drag this here and it will work okay but if you wanted to you don't really want to use a content browser you can just come here and if you click anywhere in the graph in your function you can use click on expose to library okay you can put a description to like changes normal intensity something like that and that's it okay you can put a category if you want let's just leave it like that okay and now we can just come here and press tab and normal intensity and there you go that's our normal intensity now what we can do is replace this we can just connect this one here and the normal intensity here now if we try to just connect this one here we will have an error because we haven't connect all the inputs and some inputs you don't really want it to be like mandatory such as the intensity you don't really want to have a value for that all the time so what you can do is use the preview value as default and we can put the preview value to one something like this or we can create this color pressing one and just press one here okay and just by doing that if we click apply now we don't have the error okay we don't really need this anymore okay and now what we can do is to put the normal intensity here now you see that the order of these inputs changes that's because here in the input you will have a sort priority for example this one if we put one and this one is zero by default then they will have a different order the normal map will be in the bottom following by the normal intensity in the top because this has a lower value so great now that we have this everything should work as normally so if we come back here let's open up our material instance and let's just change the normal intensity to something like 10 and as you can see it's working just all right you can just put one two three and everything works just fine just like before but now the difference is that we're having everything a little bit more organized and the beauty of this is that you can save these functions and you can use them in future projects so you don't have to redo them again so i'm going to create a material function for my tiling okay so i'm gonna ctrl c this and i'm going to right click here materials go to material function and put mf uh simple filing something like that okay just put it here and then there you go so what we want to change here it's basically first this is a vector 2 so i want to put a function input here and we will put this as vector2 okay and we will just put it here okay or we can just leave the texture coordinate actually we don't really need to change this let's click yes we don't really need to change the texture coordinate we only need to change the function uh the input here in the tiling so let's just call input here and this will be my tiling scale okay so then we can have the scalar parameter here and by default we can use the default value here let's convert to constant here so we don't have a parameter there otherwise it will be duplicated so let's hit apply okay now we need some inputs for this so ctrl c this one ctrl b and by default it will be zero that's okay so we will call this um yeah tiling x let's just call it tiling x and also we will put a tiling y tile pan x better much better and then tile pan y okay so now that we have this we can just go here delete this one delete this one too and there you go now we have our tiling perfect now you can see our tiling is working let's put a name to this uh the output will be um i don't know symbol tiling ports something like that and the description it's uh at simple tiling manipulation to the textures okay exposed to library and apply and now we can change this we can just put tiling simple and there you go so now we have everything here we don't need all of this so we can just put the tiling here you can put the tiling x and the tiling y and what you can do is to delete everything but before that let's use control here and connect this one and just delete this one delete delete delete delete and just put it like this and just like that we have made our tiling much more compact and we don't actually need to change this because the default values are already this ones but because we're using it on our material instance we want to have them so just by doing that we can just hit apply and then everything should work fine let's put a material instance here and let's look for the tiling and let's put that highlighting to one to two to three and the tiling in x they move and in y they also move so just by doing this we have created our simple tiling okay so let's do the last material function this time will be for the base color so we're gonna copy this we're gonna go to our content browser now let's save everything in case you lose it then go to materials then go to material function and let's just call it mf alvido themed something like that okay double click on this and the result will be like paint albedo color okay then we will let's put a description later we don't really need it exposed to library as always and then just paste this awesome so we have a bunch of parameters we need to use so let's go to function input and spectre 3 as always we will just plug this one here we don't really need to put this one and this will be my albedo texture okay this one won't be optional okay then you have the brightness and intensity and the saturation so let's just put this input rename this to brightness okay and let's just put the preview value here we we don't want it to be mandatory okay let's just control c control b intensity and the intensity will be one by default okay so let's control v again and this time will be the saturation and we will put it here let's delete this and the last one will be on our tint think color okay and we will put it here and the preview value and let's just put it white okay and we will put it here and this one will be optional the only one that is not optional you know it's the lv the texture other than that we're good to go so we can just put this one here apply and let's go to our material and let's just type alvido taint but well i'll be let's choose another name for this um the audio texture is here it's okay can just plug this here brightness will go here intensity will go here saturation will go here and the thin color will go here and this one will be connected to the base color now we can just delete all of this we don't really need it awesome let's just put it here okay with something like this a little bit organized but anyway that's it so now we have our color this one really doesn't um i don't feel like this one requires a function it's very simple so we will just leave it like that and i think that's it for now perfect so let's take a look at our material instance to see if everything works fine let's go for the color the brightness works okay the intensity works okay and the saturation still works okay awesome so now that we have this we have a nice material uh master material we can control the brightness the tint the normal intensity roughness we can change the textures we can change the tiling awesome so let's continue to do more complex stuff okay okay so now that we have our master material there is a new concept i want to teach you that is material layers so let's go to the content browser and here we will create something new but let's first organize this a little bit let's put our functions here and we will put it like this tree we will put it here let's move it okay and yeah that's it for now now what we will create it's another one it's a material you will see that you have material layer and material layer blend so let's create a material layer okay and we will call it ml rock something like that or um surface master something like that okay so let's open it so here the material layer looks like a function but it it's a little bit different so you can think of this as layers in photoshop you know where you are basically different materials you can use for example if you go to quicksilver bridge you can go to add quick cell content here you will see a bunch of materials you can have like rock and rock and dress and a lot of things here so you can think of this material as one of those so the way we are going to create them is by creating the note make material attributes and here you can put anything really so let's create a vector parameter by holding v okay you can also go here to the constant tree and then right click convert to parameter okay um let's just delete this one and let's just call it color let's just put something like orange and put it here and connect this one okay so this layer will be our master okay so between these what will happen here is that you will have childs of this one like for example this will be my rock this will be my grass this will be my snow something like that okay and they all will use the logic here okay so how are we gonna do this is we're going to create an instance of this so we will right click and create layer instance and if we put let's say ml rock i don't know zero one okay so let's double click on this and you will see that i have another tab here but here in the details panel you will be able to change the color okay let's create another one let's duplicate this one and let's call it ml rock zero two and the rock zero two is going to have a different color it's gonna have the growing one awesome okay so let's apply this material if you just drag this here you won't be able to put it because the material layer itself cannot do anything so we need to create a master material and we're gonna create another material here called m underscore surface master something like that okay so we will come here and here this is the material interface we're familiar with we will go here and put type layer material and you will find material attribute layers if you click on this you will find that you have like this note this note essentially will have all the materials here like raw grass snow whatever you want okay so how do you connect this because you're gonna connect this just like this there are a couple of options i will show you both of them the first one is you need to break material attributes okay and once you do that you just connect this one like this and this and so on until you connect all of those there is another way which is simple you can just go here click here in the material and then go here to use material attributes and when you do this you will see that the output here has collapsed into only one node that is mature material attributes this kind of input only receive a material which happens to be this one too okay so if we connect these two we will be able to have our material let's apply and wait for it and then go to the content browser and let's just call this material instance rock zero one something like this and let's duplicate this one okay so let's come here and just drag this here awesome so now we have our material the problem is why it looks black because we haven't assigned which material we want to use here here in the default layers we can specify which layer we want in my case i can just choose one of this if i want okay but i can also do that here let's go to my material instance let's just close this one we don't really need it that right now and what we can do you see that we have the details panel but also now we have a layer parameter step if we go here you will see that i have a layer stack okay so the background will be my for example rock one okay this will be my rock one and my rock two which is a green color i can also put it there so now you will see that my rock one i i can see the color of this one okay let me put this one here okay i can create a new layer okay and i can select the material rock02 and now you can see that all i can only see my material here now the problem is i don't have any way to blend these two together okay this is where the blend asset comes into place okay and we're gonna create that next because we need to tell if we toggle the visibility here you will see that we have the orange one and this one will be on top of it but because it doesn't have any mask it will cover all the surface of our 3d model using this material so we're going to create a blend asset now so let's create our first blend asset i'm going to close this okay for now i will close this material layers and i will just leave this one here maybe close it for now too okay so let's go to the content browser and here we will right click go to materials and then go to material layer blend okay and we will call it mlb um i don't know grunge something like that okay so let's just double click on this and you will see that now you have a material layer blend and what it's doing here it's blending between two materials which will be the ones we have here okay and it will be based on an alpha so how can i control this alpha first we just need to ignore this okay we will only work with the alpha we can just put a constant by pressing one and right click convert to parameter and we will call this alpha let's put this one here apply okay and now we will go to our material instance here and what we will do is go to our layer parameters and now here we will put the one we create which is our mlb crunch if we click on this one you will see that now i see the orange one and why is that it's because the alpha value is zero okay if i put the alpha value on one i can have 100 percent the layer one and i can do the same by decreasing this and i will learn between these two okay so what this gives us is a tremendous amount of flexibility to blend between these two and instead of use using one constant we can use use textures to decide where we want to use this alpha so we're going to do that next so if we want to use some textures we can use bridge to grab some texture from there we can go to content browser at add quicksil content and if you go here to the home tab you can go to imperfections and you can look for like for example grunge you can have like a lot of textures you can use to blend your assets okay for example we can use this one maybe we can just download and you can choose the quality for me i will just choose the medium one okay you can choose any texture you want and it will work just fine so we're going to click add and once you do that it will be here my crunch this will be my grunge texture let's double click on this and let's see what it is it's a mask just like we saw it before so we can have the accurate values and it's only using the green channel okay let's keep that in mind so how we can use this texture is very easy we can just go here and grab this one here we can convert this to a parameter called crunch texture okay now we can just plug this in delete this one click apply and let's see how it looks like now this one looks really funny because is neither one of those so let's double let's open our material here okay and here you will see that i'm using my grunge and it's having a little bit of this and a little bit about the background so what we can do is increase the contrast and i will do that by using a note called cheap contrast i can just go come here called cheap contrast okay and just by doing that i can just connect this one here and i create a constant by holding one and right click convert parameter and call it just contrast okay i can just put it on one for now click apply and let's see how it looks like now so it looks a little bit better right so if we take a look at this we can increase the contrast by putting like two or five maybe something like five it's good enough okay that's great so what else we can do well we can change the texture so because we put this as a parameter we can browse through bridge and find anything for example this mod stain we can add and here we can go to our material okay and then just change the texture here and just by doing that we will have another mask that's awesome great what else we can do well we can change the uvs and what we can do is like press u to get the texture coordinate or you can just type text texture coordinate here you can multiply it and blah blah blah but we can do better what we can do is to go to our material functions here and grab the simple tiling we create before we can just use this and of course we can use all of this in my case i will use the tiling scale only i will press 1 convert to a parameter i will call it tiling scale put it on 1 by default and put it here let's apply and nothing should have changed here but now i can just decrease the tiling to have something more interesting for example i can decrease it to make it bigger and now this one will make more sense and now i can increase the contrast something like 10 or maybe 50 and i will have something like this very contrasty or i can just go back to 10 for example okay and if i don't like this one i can just go back to the texture i had before like this one and i can just change this okay and just like that we can create different textures okay now uh let's try to have a little bit more control over my texture so what i will do is to grab one of these meshes this asset sorry and we will create a channel parameter for that okay so let's do that next so there is another way we can control our texture and that is by creating a channel mask if we go to our bridge we can browse here and find any texture we like for example i find that this damaged concrete floor is really interesting so i will just add this one okay and let's use find it here and let's take a look it has different channels like the red one the green one looks pretty much the same the blue one okay so with that in mind we can just create a different channel parameter for each one of those and we're going to do that by going here to the crunch map and instead of selecting this one we're going to grab this and create a channel parameter okay and by doing that we can just go here and type um let's just say crunch channel and by default it can be the red one so let's just grab this one here okay let's apply and now we will lose the blend we have but if we go here we can also use this mask to have like different results okay we can have the ambient occlusion we can have the height let's grab the height for example so we're going here and we will just use this one and looks like nothing has happened okay and the reason is we haven't put that channel here so what we can do is to put for example the blue one and now you see that it's much more interesting we can change the contrast to maybe five okay and now if you take a look at this this is much more interesting compared to what we had before and even put something like 10 and the tiling scale something like 0.5 and just like that we can have like a nice variation for our two colors okay so if you don't like this one for example you can change this to a green one okay or a red one it will give you just different results for me i find that the blue one is the best so it's just a matter of trying to find something that works for you okay so with that we're gonna fix these bright colors and let's create a master material when we can use other mega scan surfaces so we can blend them together using this method right so it's time to create a real material layer and we will use the master material we created before so that we can use this this one material practice we will use this to modify the layer so how we're going to do this is very simple we're just going to copy this just select this go to content browser and here i will go to my ml surface master okay and here i will just delete this and i will copy paste this one with ctrl v and i'm almost there with this so what i need to do is to grab some texture from quixote bridge okay for me i grabbed like this one this one and this one i already put the at bottom so let's try to find the rock cliff first like for example this one and let's take a look at this one okay let's take a look at the mask first first this one is the ambient occlusion okay that's one thing we need to change this the green one is the roughness okay and the blue one is the height okay so what we will do is to basically change a little bit our master material okay so let's close this one and let's open the ml surface this one my material layer okay um the base color will be the same okay what we will do here is basically grab this let's just close this so that we we won't get confused okay we only have this so let's get the base color here and we will plug it in here that's the base color let's go back to the roughness and this time we're going to use this one let's put the roughness here this is the mask okay and this one is a normal map so we're going to put the normal map here there you go so what we need to do the normal map is just like we want it nothing changes here the ambient occlusion however will come from the red channel here so we will put the ambient occlusion here and here the green channel will be here in the multiply okay so the green channel is the roughness so we will put the roughness here and that's pretty much it uh let's just call this mask okay and you can actually change this put a description here like um let's just put red is the ambient occlusion green is the roughness and blue is the height and you will have something like this so that you can remember which channel is used for what okay so just like that i think we are pretty much ready so we let's apply this okay and for for the first function here we it's my rock here okay i already have it here so it's perfect okay so i don't really need to change the textures however for that rock number two i will change the textures for something different okay so i will go to my content browser and let's just find something quite different for example this lava texture we can go here and select one by one okay let's go here to the normal map and then use the mask here okay and just put it here and there you go now you have your lava texture okay let's save this and save the rod and notice what will happen here is that i can have the textures here this is wonderful okay so what i will do now is to use this material to put it in a 3d asset and how i will do this is that i go to my bridge and i already have a asset here that i download this massive ton clip i download the nanite version and click add okay then it will appear here so this material this mesh comes with a material okay let's drag it here okay let's just drag it to the world it's quite a big asset okay awesome so now what we will do is to duplicate this one and we will put the material we create this one here so let's go here to our rock and let's put it here let's see let's prepare the shaders a little bit awesome so we just need a little bit of tweaking and we will do that next so to make this texture better we just need to change some parameters here so we can either change this in the instance or we can change it in the master material so for example if we change this layer and let's change the brightness a little bit so for example let's make it a little bit darker and save it you will see that it's actually changing everything we can change the saturation something like minus one or zero zero point two or zero point four okay save it and you will see that it actually change everything we can also change like the tiling here can change light tiling for five for example save it and you will see that everything starts to change only using one material okay so we can do the same for the second material here we can just go here and the brightness we can make it a little bit brighter save it okay let's go to unlead mode to check what else we can do we can increase the saturation a little bit maybe two or three save this that looks much better and increase the normal intensity we can put something like 2 or 5 to if you really want to make it like look really really stand out or you can change the tiling here also let's put something like five awesome the next thing we can do is to come back here to a rock and instead we can change some parameters here also if we want it for example in the layer asset we could change the normal intensity to zero if we don't want any normal intensity or we can put something like five or one or we can change the tiling to for example by default it's five and we can put ten if we want but note keep in mind that if you change from here if you change the master it won't be updated because this one is already being changed so what we want to do is to change the grunge texture we can put something like 0.2 okay and with this you can take a look at how this texture is working here okay let's take a look here and let's take a look at our rock let's change the light with ctrl l awesome now we have this texture here that is 8k and now we have this texture that is 2k but it's being repeated it looks fairly nice actually okay so what i want to do now is to show you more techniques that you can add on top of this master material so you can have more variations so let's add more functionality to our master material what i want to do is to add a snow on top and it wa i want it to be automatic so what i will do is go to bridge and look for some textures here for example this mossy ground okay i can add it i can add moss and i can also find something like this windstep snow or something like that okay i think i already have some snow here so let me take a look um crunch truck cliff there you go that's this note so what i will do is basically create another material layer i will just go here and ml is no zero one and it will be very easy we just need to type snow and we will plug in the inputs the snow put it here there we have it now we have this note here we can actually duplicate this one and create mos ml mos 0 1 and what we will do the same is we will put mossy ground here put this one and then put this one there you go perfect so now what we will do is to create another function let's save everything and then go to materials and go to material layer blend and we will call it mlb um slope mask something like that okay so we can just click here and the alpha will be a slope so let's create a slope mask just like this okay let's preview this okay so this will be the basic mask and we're gonna just use this okay later on we will modify it but for now we can just use this mask to our advantage so how can we use this will be very simple okay we can just go here press f10 if you don't see the details double click on this one and here in my material instance i can create another layer this will be my for example my snow layer and this can be my my rock too and this will be my background okay so my snow layer will use a material layer snow just like this there you go now i will have snow in all my asset okay so then what we can do is just use the slope now let's take a look at how this looks like in the world now we have a snow in our asset how awesome this is and it will all it will always work even if you rotate it like this part doesn't have because it will work on the angle now the beauty of this is that you can actually change this for example you want moss and it will change automatically just like this and you won't need to do anything and looks like this one it's uh it's having like a little bit of a saturation yeah it has a lot of saturation let's let's just put one to the saturation here we don't really want to have that much but look at this now we have moss here and you can put snow if you want okay so what we will do is to modify this slope material so that it can have even more detail so if we want to make the slope mask a little bit better what we can do is to play with the parameters here so we can go to our mlb slope mask and you will see that i have different you know inputs i can just create some of those inputs here for example i can put a normal map so i can just put a texture here let me grab one of this rocks for example like maybe this one my rock cliff i can use this texture i can just put a right click and texture sample okay and i can just convert to a parameter like normal map or tangent normal okay you can put it like this or a slope angle we can put up another parameter for this by holding b and we will call this a slope angle by default we will use the blue channel because the blue channel is using you know the c-axis if you take a look at this one you can see that i have three channels here the blue one which is you know blue the z-axis the x-axis and the y-axis okay so we want to project the slope angle only in the z-axis okay but you can also change it for example if you're making trees or something the snow can accumulate like in the corners of it it can be very helpful so let's just have it here the next one is the falloff power so press one right click convert to parameter falloff and just put one and then we can go to the cheap contrast here ctrl c ctrl v and call it contrast and put it here and there you go we can just apply this okay and let's see how it changed okay so it changed a little bit it's less harsh than before so if we take a look at this one let's go here and what we will do is to go to the blend asset and you will see that i have like different parameters i can play with so for example i can play with this slope angle for example i can go with y and it will accumulate in the y direction okay can go both actually okay but i prefer to go blue okay and then next one is the follow so i can increase the fall of like two or five to make it like more smooth or 0.1 to have it like very harsh the contrast can put it like 5 or 0.1 put like zero okay i find that by default it's working quite well so let's just leave it like that so let's take a look at what other things we can do for with this texture so let's do some vertex painting what we will do is to close this so we can be a little bit more organized okay perfect we don't need the bridge anymore and let's create another material layer blend and let's call this mlb vertex paint something like that okay so we can do some vertex painting we will put it here and it will be very simple we can use comb here and put vertex color okay and this time we're going to create a channel parameter like we did before channel parameter and we will call this vertex channel and by default it will be the right one so let's click here click apply okay so now what we can do is to come back here sorry go go back here to my material instance and go to my layer parameters and let's create another layer and by the way before we continue make sure all your textures are liking wrap knob otherwise it will be it can have some issues so what you can do here is to go back to your material we have a lot of materials here uh let's go to the surface master and this one click all of those and change the sample source to share wrap otherwise it may cause some problems okay so you want to do the same for all of this like the material layer one we can we can just leave it like that because we didn't really change it let's go to the number two um we also don't need to change it we only need to change the master so uh let's go to the material layers here and let's add um i don't know by moss paint something like this and we will put something like let's just put the snow for now okay uh let's put the snow here just for now okay so uh by default it will be everything covered by snow but i will put the vertex paint okay and my vertex paint will be the red channel now it will be still red because if i take a look at the mesh paint and take a look at the rgb channels everything it's white so what i can do is to paint here and paint everything blue black okay let's just paint everything black fill and apply because we are using nanite we cannot have per instance vertex painting so we need to apply these changes so it's going to take a while let's wait a little bit because it's a very heavy mesh okay so it's finished now all my vertex painting is black and that's okay so what i can do because nanite doesn't support vertex painting i can just come back here and disable nanite support click apply and with this now i will have a lot of triangles to work with um the later on i can turn it on but for now we can disable it okay so it's finished and let's go back here and you notice that my computer is a little bit slow let's hide this for now because i don't want to render it and what we can do here is go to the mesh paint and now you can see my rgb channels are all black so what i can do it's actually paint here what i want to what where i wherever i want to apply my color i can just paint in red channel swap the color here to paint on white but i can just do something like this and just like that i can paint vertex color and i can basically put anything i want just like this okay and once you do that you know it's a very heavy mesh uh which you can just apply or just leave it like that if you want but i recommend you do to apply because nana doesn't support per instance vertex color so we will apply this continue okay so now that we apply we can go back to our static mesh and enable nanite so let's saving wait a little bit enable nanite support apply changes okay so nanite hits enable again and now we have our mesh with our vertex painting okay so what you can do here is basically uh open this and you don't want to put the snow you can just put the moss if you want and now you will have the moss here just nice i mean so you can just paint everywhere you want and of course it will apply to all the meshes and of course you can change this to use any material you want like for example maybe this one okay and then it will change again and you will have different results here okay so this is basically vertex painting and you can do a bunch of sort of things with it but uh what i want to do is to have a more sophisticated vertex paint so how we can do this vertex painting more interesting let's go to our material first and let's just change this to use the moss again okay so we have something to look at there you go so this is our vertex paint and you can see that it has like a smooth transition here like something like this and that's not very natural so what we will do is to blend this vertex paint with a high texture so let's go back here to our vertex color and what we will do is to put the height lerp there you go so the height lerp will learn between two values based on a height map okay so these ones are optional the transition phase will be this one okay this will be my transition phase then the high texture we will drop one high texture from this one for example we can grab the height from this let's go here to my vertex paint put it here and put my height mask okay and i will just plug i if i if my memory doesn't betray me it's on the blue channel so let's just go back here okay and let's grab the blue channel there you go and then the contrast we will put one and then create a contrast node okay just put let's just put one by default now for the outputs we can use the alpha okay so the alpha just can come here awesome so just by doing that let's apply and let's check how our texture looks like okay so let's go back here to my rock and let's try to make it this a little bit more interesting we can increase the contrast for example like five or 1 or 0.1 okay and you can put like maybe one here and now your transition will be much harder harsh it's much more harsh or harsher whatever you want to call it so 0.5 it will have like a smooth transition 0 is kind of like what we had before and just like this we have like a nicer transition okay so this is basically vertex painting uh you can either do it like this or you can have a height lerp and blend between this height texture okay what you can actually do is to put a simple tiling here and we can create a scale right click convert parameter is like filing here we will put one and maybe it will have some effect on it maybe not but let's take a look if we go here let's go to the tiling let's go really close and we can change the tiling to 0.1 or 5. and go if you put like 50 you will see that it's actually breaking out like 100 like maybe 40 is like a nice number yeah 40 is a really good number so if you take a look at this now your transition is much better like if you put like one it's like very smooth you put like 40 it will look much better okay so um this is vertex painting in a nutshell you can put anything you want you can like change the roughness or things like that so just remember that if you want to create some nice vertex painting the height layer is the node that you want to use with the transition phase with the vertex channel so one feature i would really like to add is to be able to paint water puddles so in order to do this we need to go to our master surface material and we need to modify some attributes based on an alpha okay so here what we will do is to uncheck material attributes and here you will break material attributes just like this okay so just by doing that we are having the information that we are having here and we are getting this information to modify it so in order to make something look like water we need the color to look darker and also the roughness to be really low so how can we do that well now that we have the color we need alert note with holding l we can put a linear interpolate this one okay our loyal linear interpolates super helpful so what you want to do is to create the alpha and which alpha will be we can create as always a height lerp and the high texture can be anyone so for example i can grab this one okay and i can also put the uvs with my simple tiling we created before and i we can just put it here and put a constant with one convert to a parameter and call it um i don't know water height tiling something like that okay and we can just put a value of one and just leave it like that and we can put it uh let's just put last the blue one okay then the contrast will be press one right click and put uh puddle contrast something like that and put it on one by default okay so now we have our alpha and we also need a transition phase so let's go to vertex color and we need to choose a vertex color for this uh i will choose the green one okay and i will grab the alpha and put it here okay now what do we will we put here first we will put the base color here but also we will multiply this and let's just put another constant and call it like um puddle color and we can put something like 0.25 maybe so we can darken the the value of the base color and this will be here then we just need to connect to the base color just like that okay and we can also do a make material attributes okay if we want it so let's just put something like this and connect the material attributes to this one okay it's like breaking and then make them again so we have the base color here let's make some space to create the um the roughness the roughness will be the same i will control c and control b and the roughness will be on a and this one will be maybe multiplied by 0.1 okay and the alpha will be always the same here now uh it's getting a little bit messy so i will show you a new node called the name so if we put here type name we will get that at name we wrote declaration note if we click on this one we can just call this like um puddle alpha something like this okay and now what we can do is type name again and we will see that you have the puddle alpha here so you can just connect here and ctrl c and ctrl v and connect here again and this way we can have a more organized graph okay so now that we have the roughness we will put it like this the metallic still the same specular still the same uh let's just say the normal um the normal we need to we need to change it a little bit okay so what we will do with the normal map is to grab our normal intensity node what we create before grab it here and let's reduce the intensity put a constant here with one right click convert to parameter and call it puddle normal intensity and we will put something like 0.2 maybe okay let's just put it here okay and just like this we're gonna copy this uh copy the lerp node put it here delete this one the new normal will be on b the previous normal will be on a and the alpha will be my puddle ctrl c ctrl v connect the alpha and then just put it here awesome so just by doing that we need to connect the ambient occlusion and we are good to go so let's hit apply and let's see how we can test this out so first thing i want paint on this one because this is a really heavy mesh so i will create and you go to modeling tab go to rectangle and click here click complete and there you go now we have a plane we can test okay so here what i can do is to apply the material here so let's go to our materials and we will grab the sorry the rock here and we will duplicate this one and we will call it mi ground zero one okay so we will come here and plug it in now we will change some things in the ground okay so you can see that now i have my parameters here okay i want to modify them later and also what i need to remove is this most paint i don't want to use so let's just remove this one there's no i also don't want to use okay and that's it so first things first we need to change the vertex painting so we will go to the mesh paint go to paint because we are having our all my rgb channels are white it means that the blue channel sorry the the green channel it's painted so we need to remove this so we're going to put select all of them swap them and then fill and just by doing that we have removed the green channel from here awesome so what we can do now is maybe change this one for the most to have something like this okay so now that we can what we can do is to paint what we need to add some resolution first so what we will do is to go to the modeling tab and then go to remesh and let's put something like 1000 should be good enough click accept and that's it we're good to go let's see if our mesh paint works let's go to paint okay and let's paint the green channel and let's click here to swap the color i'm painting white and let's just start painting okay so we're having something here it's kind of working and it's a little bit dark for my taste so let's go here to the parameters go to the details and let's change the puddle color to 0.25 that's much better let's put like zero point maybe zero point 0.35 that's a much better option let's see the contrast can be zero much better too let's see the water high tiling if we put something like 10 you will see like we have more variation and this will be more obvious with the contrast you can put something like this but i find like the contrast putting it like zero works very well okay so then that puddle normal let's see if it works with one so you can see how the normal actually really works when we put the normal intensity down it feels more like water okay so we can try 0.5 for 0.3 0.3 looks like a nice number okay maybe 0.25 awesome so what we can do is to basically increase the size and reduce the strength and we can just paint something like this we can shift-click to erase erase some data something like this and we can shift click and basically we can have different puddles here okay let's increase the strength something like this awesome what you can also go and do here is let's save this and you can actually sculpt a little bit to have like a ground feeling go to modeling tab go to sculpting mode and by the way if you're new to this we have great tutorials on how to model uh inside unreal make sure to check it out you can just move this a little bit like this to have like a little bit of variation here there you go awesome let's click accept and now we have like our little terrain and we can paint here and we have our puddle and from this angle it looks quite nice what i feel like it needs also it's the puddle roughness and let me see i think i didn't put it here yes the puddle color should be also the puddle roughness okay make sure to put it right otherwise will have trouble okay so now let's check the roughness if we put like zero if you put one you see that it's very rough it doesn't feel like water but if you put the roughness to 0.1 0.2 0.5 0.2 looks like a good number okay let's paint a little bit too let's go to paint with green and with shift select and just do something like this awesome it's paint here like the puddle is in this area with shift click you will delete and this is a very useful feature adding puddles to your game it's can really help it to add more variation and more detail and this is a really simple way to add puddles to your environment so now that we have our puddle let's create a function so we can add it anytime we want so if we go to the content browser we can just create a new function go to materials then go to material function and call it mf puddle okay so double click on this and we will copy everything here ctrl c ctrl v here and let's start modifying this little by little okay so the first thing is the material attributes we want to replace it by a function input and the function can also be a material attributes type so this will be my material okay this won't be optional this has you must have the material here the next one is a simple tiling so let's just put a input here okay and put it as color value remove this one put it here and the preview value by holding one i create a constant connect this one and put something like one and then check use preview value as default because i don't want this to be mandatory now the texture sample i will just leave it like that and we don't really need to change it then the vertex color um it could be it could be the the green channel let's see if there is an input for uh for a channel here not really so let's just leave it as a green okay we don't really need to change this one the next one it's here we will change the puddle contrast so let's copy this and let's just put the contrast here puddle contrast there you go it's a preview value of zero it's okay then the alpha stays like this and then this one we will change all of this for our input so let's just put the uh let's just click the arrow here to make it smaller and we will call it paddle color okay and the preview value will be 0.1 and you don't really need to put it as mandatory okay you do the same here ctrl c ctrl v and this one will be puddle roughness and we will leave it at 0.1 actually this will be like 0.35 and this one will be 0.1 and we will put it here and we can delete this one and the next one it will be the bottle intensity or the normal so we will put bottle normal intensity and we will put a value of 0.2 just like this one and we will put the intensity here okay it can be a little bit messy so let's try to organize a little bit just like this okay so the next thing is to expose this let's call this material with puddle okay description like paints ads puddles with the green vertex channel something like that okay and then we come here and we don't need a description exposed to library hit apply okay so it will be very simple now we can just go to our master and we can add the water uh sorry puddle mf puddle so we can just put this one and you will see that i have the material here and what i will do is to put the material on top first so let's go to the puddle and let's select all the inputs all this inputs here and let's change the sort priority to one okay i think i'm not forgetting anyone okay great so now when we hit apply we will go here we have the material here so we can just put the material and we can just delete all this so we can just put the puddle color put it here we can put the puddle contrast and put it here too okay we can put a puzzle roughness and put it here and then the normal intensity and put it here now there is one input here that i didn't name and that is that tiling so let's rene let's name this as um hide tiling okay hit apply let's save this and if this doesn't update um come to the puddle now you will see the high tiling here so we can just wrap with control all of those roughness for the raw normal intensity and the last one will be the height tiling which is this one you can just connect this one here and what we can do is to delete all of those we don't really need it anymore okay we don't need the alpha here we don't need anything of this so what we will do is to basically hey i have my materials let's add some bottles and then just connect to the material attributes and just like that when we hit apply you will see that everything works just as expected and everything is much cleaner now now we have our material and we have our puddle function where we can just paint puddles and if we come here we can go to the mesh paint and come here and start painting here and we can continue to paint paddles like this awesome thank you so much for watching remember to subscribe if you don't want to miss more content like this one if you are the type of person who wants to learn more and take your game dev skills to the next level check the links in the description you can become a member or visit our website to check some awesome premium resources i am mao and i will see you in the next one
Info
Channel: UNF Games
Views: 24,775
Rating: undefined out of 5
Keywords: unfgames, unreal engine beginner tutorial, unreal engine 5 tutorial
Id: TSPbHLHmDJg
Channel Id: undefined
Length: 139min 25sec (8365 seconds)
Published: Fri Jun 17 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.