how to create a Sand Storm in Unreal Engine 5: Part 1

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everybody so today we're going to be going over how to create the sandstorm effect for the environmental Effect series we'll be using subon designer to create some textures and reuse some of the old textures from the previous tutorials we'll also be going over how to create the Shader Blueprints and particle effects if you have any questions comments or any requests please let us know below all right then let's get started so for this effect I'm going to create my textures using substance design er um it's not going to be something really complicated or anything like that it's just going to be simple nodes and a little bit of levels so to get started go to the new substance graph uh make sure that the uh size is 1024 by 1024 and press okay so it's going to be really simple I'm just going to blend between three to four textures and use a cloud texture so uh I'm going to use the dirt uh noise for this one and dirt two so part of the reason I wanted to use these two is because I can blend between them and still maintain uh a bit of uh depth between the layers so if you watched my tutorial for the mes effect you saw that I created four layers of textures that I uh did an opacity on from uh 25 50% 75% and 100% this is exactly the same technique but in a different software so to do that uh I'm going to take these three textures and I'm going to blend them using a blend node and to show this uh menu just press Tab and you'll see the menu uh and it's the second node blend and you'll have the foreground which I want my uh the busiest to be in the forground ground and I want the background which is going to be the less busy and the opacity will be through uh the last sture which is the cloud one and when you look at this you'll see that some of the uh dirt in here has a bit of different opacities and that's exactly what I'm looking for when trying to do something like this so it's is easy as that and also the textures are tilable and in Photoshop the only unfortunate part is if I'm going to do this I have to do it with a brush uh with the four layers and then have to do it through a uh offsetting which you basically offset the frame and have to fill out the uh rest of it just so you don't have any seams and for substance designer this is just normal that it is dialable okay so now that I have this blend in here the next thing I'm going to do is a um level node or levels just so I can add a little bit to my uh opacity or take away from it a little bit okay this is perfect and for these I'm actually going to increase the scale so let's do three so the bigger the scale is the more uh shapes you're going to get in there and I understand that when doing something like this it's a bit scary to try like and increase the uh the scale of it because you might not have the right resolution but you can also change this in the engine um the reason I did it in here with the texture is because I want to get as much uh noise and as much uh resolution as I can so when I change the size in here it wouldn't lose its uh wouldn't lose its quality okay so the next thing is for the dust going across the screen for example uh I'm going to just going to use this Cloud texture to be honest like I'm not going to change it uh well I'm just going to randomize it here and I think this looks fine and if I have anything uh that I want to change or uh just edit I'll just come back in here but yeah um and to save these just double click the note that you want to save uh save uh icon here and just save it wherever you'd like and yeah so let's import these to Unreal all right now that we're in unreal let's import our textures we got the cloud and sand all right uh as you can see I've already set up a fotage structure for this this is just for my peace of mind and just a good practice in general okay I'm going to go to the material and create material and call this sand underscore camera uncore attached okay now that I'm in here uh I'm going to want to import my textures into the material editor so there are two ways to actually do this you can uh select your textures and just drag and drop them or you can can hold T and left click and you'll see that it already selected the texture that you wanted that's because this is highlighted but if it's not and you hold T and click you'll see it empty here and you can just pick your textures from here okay going to delete these two so now that I have my textures here uh I want to break this down a bit in a way that uh it's a bit understandable for me right so how I break down my effects is by their Simplicity and complexity so what I mean by that is no matter how complex an effect is it's good practice to break it down from its simplest uh form to its more complex form so for example uh I have this uh this texture and what I want to do with it that's how I start so for example I wanted to animate from left to right or from right to left so one thing that does that is the Panner note so if you hold p and click you'll see that you have the Panner note here you have coordinate time and speed so what speed is used to basically animate from X and Y so if you click here and then you do uh one in the X you'll see that your texture is moving in the x- axis uh or sorry not x-axis but in the X Direction which is u and v so this is basically using the UV coordinates to move the texture so if I preview the nodes that's what you'll see let's say I wanted to add one to the Y and it will basically go upward and to the uh left so coordinates it's basically used used to uh tile the texture or uses its coordinate to get it tiled so if you hold U and left click you'll see the text coordinate which is texture coordinates if you add it in here you'll see that nothing really changed but if you go into the texture coordinates and you increase the tiling with a u you'll see that the texture is stretched now so if I added to the V you'll see that the texture started to repeat in a uh bigger Atlas and that's what this is for so this allows you to basically have it in a way where you can control that so there is also another way of doing this which is using a uh a little bit of math so if you hold a uh sorry hold M and left click you'll see the multiply right so what you can do is multiply the coordinates by two constants and a uh a pen node so to use a constant uh there are two ways to actually create a constant uh you hold one and left click and you'll see your node or you hold s and left click and you'll see a parameter constant so what this will do if you use a constant parameter and as soon as you save and create a material instance this parameter will show up in the material instance so let's say for example I want to control the uh tiling for this texture but in a parameter so one way to do that is to use a append node uh aend Vector this one and I'm going to use this as X and I'm going to use another one so you can control uh C control V and you can do y or you can call it u and v it's up to you I call it X and Y so if I append this and then multiply it so now it's at one so if I preview this you'll see that it has exactly the same results and if I add that into my texture let me this back okay perfect you'll see that nothing really changed but as soon as I start to change these values here you'll see that it's started to affect it so let's say I save this and take it into a uh um uh into a material instance so I'm going to save and I'm just going to add it into the missive color and save it if I go into here create material instance see here you can just control the uh XM why so part of the reason why I'm showing you this is because we're going to create a really big material to control this uh Shader and it's just basically going over the basics of creating material instance and a big Shader okay so now that I want over the coordinates you can actually do the same thing for the speed so you can copy these two uh these three nodes and you can add it to the speed and it would does it will do the exact same thing so if I put this to zero and this to zero it will stop so now you have control over the tiling and you have control over the speed so if you add these two together and let's say for example uh we call this speed X and speed y and we call this tiling X and tiling y now if you look at the texture and just add the basic uh parameters back in or not the basic sorry the default parameter of these nodes you'll see that you still have your uh you still have your texture and you still have your uh parameters so if I save this now you'll see that I have my X and Y speed so if I add this here just add any numbers that you would like and you'll see that it's actually animating and what I'm doing here is basically just reverting it to default so I'm going to save this here back into the [Music] material and yep okay so this is basically what I want when it comes to the behavior so now that I have that behavior let's add another node uh sorry let's add another texture that is the same so and why am I adding a different texture so having multiple textures on top of each other and moving at different speeds gives it a bit more um Fidelity and complexity so what I mean by that is let's say I have this setup here copy and just change it uh here because if you have the same names for these um for these parameters it will actually change them at the same time so let's say if you see these two right now if I change it to two it will automat ially change it to two here so oh did not change it weird I think that's a bug oh okay but uh I don't want it to behave this way so uh what I will do is actually add just something to the naming so for this one I'm going to call it a text underscore 2 underscore tying X so what that will do this is basically going to call this texture 2 and you're not going to basically have an issue with it when you change the numbers so I'm just going to copy this right here just add it to everything else oops okay so now that we've added everything here let's say I want these two to go in the X Direction so for Speed we go X and for Speed we go X and what I'm going to do is actually add them together so to do an add node is hold a and left click and it'll give you an add note and I'm going to right click and start previewing so now you can see nothing really changed here so if I go back in here and change the speed to point two you'll see that there is a little bit of movement differentiation where you have one is going fast and one is going slower so let's say uh I change this and to translucent and add this this way so now you can see it a bit better so for me right when I'm doing something like this I just think about it in a way how would I trick the player how can I get rid of the comp uh add the complexity and get rid of the uniformity this is this is one way of doing it so adding that um the speed differentiation is or the the speed difference uh gives it a bit more complexity and add on top of that changing the actual tiling you will get something like this so if I change the tiling X to 0.5 [Music] or I think part of the reason uh because I changed it to 0.5 it matched the speed just a tad bit because it stretched it just a bit so if I show you this is what it would look like but that's completely fine I'm just going to add a multiplier into here just so I can uh change the value of it just a bit uh let's see start previewing and the same thing here I'm not going to keep this one out I'm just trying to show you why I'm doing this this way so let's say we add 0.5 to this you know what .1 okay so now you see like there's difference in speed difference in tiling and this will basically break the illusion of um having the players looks look at something and say oh okay this is repeating or this is uh looks a bit weird and so on so that's basically just adding to the complexity of your Shader or your effect okay so let's see let's add that's the tiling let add more to the speed just to Showcase this okay but you get the point I hope I hope I explained it right uh okay so to go back to this uh let me remove these here okay so this is why I made these parameters because I want to have more control over my Shader uh so yeah also one thing to keep in mind you can actually use multiple uh you can use one Tech coordinate to for multiple textures and so on but let's keep it this way just to be bit organized okay so now that we have these let's just reset them to their original sizes and zero and zero for the speed for you okay all right so now that I have this one other thing I want to add to add even more complexity to this is add a UV Distortion so to do that I'm actually not going to change the texture at all I'm just going to leave this here make another texture which is the same and use the same setup here uh copy it paste in the back and for this one I'm just going to use it to um so for this one I'm just going to use it to distort the main texture which is this one so to do that I'm just going to call this uh D for Distortion and go to the tiling speed see as much as I like to just add things together and call it a day the problem with that comes where you don't get uh you at some point it looks a bit boring so to add even more complexity and more uh shape into it you add a distortion or you add something else to the mix to keep it interesting and that's basically what I'm doing here so uh let's see I'm going to remove this do a multiply and just do a uh constant parameter and again to do this uh is uh hold s and left click and also if you have this one which is when you hold one and left click you can just convert it into a parameter this way too and I'm going to call this disor okay and now I'm just going to add it to the texture uh right I need to use the green channel for this okay so now if I preview my texture here you see there's like nothing that happens but if I do the Distortion uh here add just one to it you'll see that I have a bit of distortion to it so let's say I want the Distortion to be a bit bigger so I just go to the back to the tiling and just change it from here and now let's say I want speed to the Distortion or movement I go to the uh speed and add it to it let's not do it in here and I'm just going to do it inside here in a second okay uh let's actually before I move on there is one thing I'm going to do to basically do a bit of housekeeping so I'm going to copy this here and go go into groups if you highlight all these nodes and go into groups and just uh type in whatever you want here it will actually group up your uh parameters just for housekeeping so you wouldn't have like a big list of things to worry about so it put it in Distortion I'm probably misspelled that uh but yeah so if I go into here back Distortion and for example for these I'm going to call this texture one and for this one you can actually I don't think you can group it but uh I will convert it into a parameter this or just paste whatever I po it here and if I save this uh and go to the material instance you'll see that the texture for the Distortion is here and I can actually change it to whatever texture that I want and I don't have to be confined to that same texture okay so now that I have these grouped I'm going to call this texture two okay so that's grouped all right right okay so at this point there is one other thing I would suggest doing just for the sake of your mental health when it comes to looking at materials and spaghetti uh highlight all of the ones that you're uh want to group and control C or just C actually sorry and here you can just section them off and call them uh uh like for example for example this is Distortion and let's say this one is a Panner or you can do text texture one uh Panner like this for example and you can do texture two Panner and this would just save you time if you're let's say for example and this I was guilty of this for a long time when I do my materials I don't comment on them and later on I have to go back like okay what did I do here like why does this look so foreign to me so yeah okay so now that I have these here my next step is to actually create a mask to have it um so the mask will basically be a top to bottom mask so it will hide your uh texture or Shader from when the player looks at a certain direction it doesn't see a cut off point so let's see apologies I actually hit the stop record button while I was talking like half almost for like 20 minutes so to go back into this um first thing I wanted to create here was a uh mask to hide the cuto off point which was a if you hold U and left click you'll see a text coordinate if you add a text coordinate with a component mask so for example if you do shift C you'll see a uh mask if you actually preview that you'll see that it has the coordinates of the text coordinate so what this will do you can separate your red and green channel so what you'll have is something like this so you'll have a gradient from white to dark so to actually uh what I want this to be is uh the dark to be at the top and bottom so one trick to do that is to do a one minus which will flip this actual uh mask into something like this and if we multiply this by holding M and left click you will get this result [Music] so that way if you multiply this result with your original texture or Shader you will get something like this so now if I uh add this to the opacity you will get something like this so you won't have this hard cut off point uh anymore okay to add a bit of more to this because I want I do want to control how much I can affect this so if you do a multiply with a scaler and call this um mask and let's add it into here okay going to give it a value of five for now and of course I can control this when uh however I want uh later on so next it will be a clamp uh clamp just to clamp the values uh for this and after that let's see let's do a depth fade so what the depth fade does is actually when you have a um let's say for example you have a a material or a object is intersecting with the world or something else it gives it that uh fadness so you wouldn't have a heart cut off and I'll show you what I mean in a second and that'ss here and call it depth oh a scaler and call that a depth fade okay make this at like 500 for now and I think I should be good to go oh actually there is one more thing I need to do well a couple other things first let's add a comment to here and call this uh mask and have that here next I am going to do the texture uh sample by holding T and left click and I'm going to grab the sand texture again okay next uh I'm literally just going to copy these here again because I want this to be a bit more I still want more control over this so let's see how this would look like so I'm just going to call this this sand instead uh sand tiling and send speed okay so if I add this texture to to this result actually if you hold control and move the output result into this one and then add them together you'll see that I've also added my dust in there or my uh sand okay so there is two more things I want to add in here one it would be a control over these individual uh textures so the same way I did here for the Distortion I would do with this so let's say for example I want the foreground to be more has more density or more opacity than the background this is how I would control it so if you do a multiply with a scaler and you call this uh uh texture new texture one [Music] underscore and you basically can copy this again I'm going to do texture two and for this one I'm just going to call it sand opacity and I'm going to add the value of one so part of the reason I'm doing this is because let's say for example uh if you're doing this in a dynamic weather type situation and you want to increase a value of one of your uh one of your materials or one of your Tech like for example if I wanted to increase the sand I can increase it this way while keeping the other values the same and I can also uh change the tiling and so on so I'm going to put this back into one and just add a comment to this send uncore Panner okay so now uh the only thing that's left for the Shader itself when it comes to the look is the color which it will be a multiply with a a vector 4 or a uh or a a dynamic Vector uh or say sa Dynamic Vector is more of a parameter Vector so if you hold four and left click you'll see this color vector and you can pick whatever color you would like from here but what I'm going to do is convert it to a parameter and call this sandore or storm or sandore stormcore color okay and I'm just going to attach it to here again I have this type of uh color picked for these so I'm just going to use uh this one so these are the the numbers for it if you want to copy them okay and the last thing that is left uh is oh right so one more thing left which is the world position offset what I will like to add in there is a way for this to be added to the uh camera so let's say for example I save this and let's take it into the world and let's say I have a sphere here let's see sector so let's say I have this sphere here and I want to attach this material too so I can control it when it's in the world right uh let's see I'm just going to drag and drop and that's the sphere that I have for this material so the next thing I want to do is actually attach this sphere to the camera to show that it's like in front of the player and it's basically in the world so to do that it's a simple uh three node which you have camera uh position and object position and you just subtract from you need to subtract the camera position from the object position to do this and the result will look something like this uh I maybe have flipped it no okay maybe it's that's weird let me play it from there okay uh let's see what are we missing here oh probably because it's not a two-sided material yep such simple things we forget all right so that's the effect that you'll get when you're like in the world and also to uh fix this issue that you see go to the left side of your material detail and scroll all the way down until you find Max roll position offset displacement and just put it at a really really high number and when you look at this it needs to be higher oh I didn't save that's why now as you can [Music] see this is the result that you're going to get with the Shader so uh part of the reason we're using the material instance because you can actually just do your changes on the Fly and you would didn't really need to go into the material again unless you're trying to change something so we're having the material go sideways so it's going to be in the xaxis or in the y axis actually so I'm going to kill the Distortion first not have any in there uh let's try and start actually let me just make this into a better okay so just going to go back in here for a second and make sure that I change these into a parameter for the shaders call this sand switch this and call it text two and this one texture one okay so now let's do this and just activate all of these parameters I know it's going to going to be a lot of work just you know going through every single one of them but don't forget that you already uh grouped them up into groups I didn't do that for this so that way you wouldn't really fall into that trap of having too many things to worry about uh let's see so these are the opacity okay so for the opacities let's leave them same way let's try zeroing out this okay so let's start with the tiling first so let's go with uh the Y AIS and do the sand this is going to be try 10 and like this seems nice for now okay I'm going to do8 and then 10 for the X uh for texture one let's zero that okay so let's set this to 0.5 oh I see what's going on with this uh it's because of the Distortion and I need to kill it uh so let's do zero for now okay or maybe just one right uh scrolling down okay perfect so let's say 0. five should be fine for this and three for this one and then for the second one tiling going to do 8 and maybe not let's try 04 and eight maybe five for this you really wouldn't tell until you start adding the speed in there how things would look like so I'm going to start by 0.5 on the Y AIS for everything just to see how it would look like so if I play from here I would have this type of effect and if you run or go anywhere should be good to go okay so let's see how it would look like in the world if we start changing the speeds go with2 for this [Music] one and let's try six this and for texture two I'm just going to add a tad bit in the X so it has that difference in it and just take a little bit just to see what it would look like all right okay let's see I'm going to increase some stuff here a little bit I'm going to decrease the opacity for no increase the opacity for the s texture and increase decrease the tiling for it so let's see five and so I can see what it would look like okay that's nice all right from this point on it's basically just trial and error on how thing would look like or how things would look like uh let's see I think for now I'll leave it this way and when I start adding everything else I will get to a point where I start uh changing a lot of stuff in here and basically just get to a point where um adding everything together like the particles the fog and all of that stuff in the level will give me a better result than just doing all the changes right now okay so now that we have this I'm just going to delete it for now and bring it back later
Info
Channel: Mad VFX
Views: 1,533
Rating: undefined out of 5
Keywords: sand storm in unreal engine, unreal engine 5 sand storm, unreal engine 5 storm clouds, unreal engine 5 storm tutorial, unreal engine dust storm, unreal engine sand storm, unreal engine storm, unreal engine storm clouds, unreal engine storm tutorial, unreal engine stormwind, ue4 material, ue4 materials, ue4 sand, ue5 sand flow, ue5 sand shader, ue4 sand tutorial, ue5 sandstorm, ue5 shaders, ue4 tutorial, unreal engine 5
Id: m7rw_5SZSrs
Channel Id: undefined
Length: 47min 40sec (2860 seconds)
Published: Mon Dec 11 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.