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

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
all right our next step is to add the terrain so for this I actually added something called the PDG desert scene from side effects and it's a really good uh environment to actually add your effects to if you're doing anything that has to do with sand or just testing things I highly recommend it it's a really great setup so as you can see here I have like couple of things in the background and I want to focus example on something like this and make it the center of my piece so if I just take this level and make it the center as in this is what um this is where my camera is going to be and this is where we have everything okay so first let's hide the other uh environment or L Escape we don't need that all right so now looking at this from my perspective I look at it is a it is a bit boring it doesn't have any movement it doesn't have any life like the only thing that's actually moving is the clouds even that doesn't really give me any information so to make this interesting we did the sandstorm uh Shader now let's add the uh supporting elements to this so let's say for example when you see a Shader like that for example you'll see that it needs to have wind it needs to affect the world it needs to kick up dust or sand or anything around it so two elements are going to be added in here which is a particle system to support the fact that there is wind and a an addition to the terrain Shader to make it so it looks like it's uh going in a direction of the wind right so if I was working with a t artist I would actually add that uh their job would be to help me uh set up like a wind direction and I would set up how the logic work where for example uh the Shader would work with the wind direction the particles would work with the wind direction and so on but for this one I'm just going to do it in the Shader itself so will save us both a lot of headaches okay so uh let's see I'm going to go into the terrain material and let's see terrain okay so here you see that we have our um output which is the terrain material so I'm going to disconnect all of these here and add uh a little bit of uh things to it so one thing you can do here if you don't want to change anything in here and you want to keep it the same way right you just want to add to it there's something called uh material attributes es so if you do uh material uh I think it was make material attributes so here you see that you have um material attributes that resembles the output material and what this does this allows you to have like two different uh material uh attributes and blend them together into the output so let's add this into the roughness or was it the normal I think it was the normal normal roughness and base color okay I'm just going to go back to see because I kind of forgot okay so it was right so if I do uh make material so just grab this one grab the roughness and the normal so if I view this it basically has the same results like the output of this is the same exact thing as this except if I add another one for example uh I just hit control D to duplicate and then added let's say for example a texture but if you hold T and left click you'll have the texture sampler and I just did this in the base material and just picked um uh let's see actually I'm just going to pick this uh or actually I'm going to pick the cloud one that we did perfect so if I view the node this is my result so now here's the thing the same thing as the Shader I'm going to add my other uh uh my other logic to it so or the other note we need a parameter for it to move we need a text coordinate we need uh two uh constant parameters uh and append uh and Vector we need a multiply and a another I'm just going to copy this it to the speed and to here so what I'm going to call these this one will be wind underscore stying uh X and the other one will be Y and this one will be wind underscore speed underscore X oops this one will be y and the same thing for this okay so what the reason I didn't go over this particular one pretty quickly uh is because I already did in the first uh Shader all right so now that we have these two materials not materials sorry these two uh parameters now I can just blend them so there is a uh blend material attributes so this will allow you to blend these two together using a scalar parameter and I'm going to and I'm going to call this um wind underscore blend okay so here uh there is another way to do this but well not another way to do this but if you ask why did I use not use alur it's because you can't use alur with uh bees so one more thing is you need to have a used material attribute uh checked for this to work if you add it together now you'll see that it works if I do .5 so now 50% of the material is applied here um H okay knowing that this is going to be also projected on Sand I need to change the color so I'm going to multiply it the base and make a color got parameter call this colorcore wind and just change the wind take the alpha into opacity let's try this because this might not actually have an alpha does it yeah it does not oh wait doesn't even have the other channels uh that's fine I'll just do this okay so now if I actually move this in let's say the Y AIS save this now you can see that it actually projected to the terrain so this is a little bit too much for this so I'm going to just go into the material instance for for the actual uh terrain oops save this go to material instance and actually let's do this group them all together call this wind and Save and under the wind you will see all of it okay going to save this look at it in the world okay so this is going to be to small so I'm going to incre like decrease the uh tiling till I get a good result for this okay I'm just going to come back in here convert this into a parameter callid wind uncore text and save one of the reason I did this is I have a lot of noises like noise textures and things like that so I can pick from I'm just going [Music] to uh choose one that looks good okay now I'm just going to just trying to get like a good speed slash uh look for this this doesn't look bad okay try this awesome this looks nice actually maybe let's try to do two increase the speed by another perfect so for now I'll leave it at this uh I will change things around just so I can see if um things change or like the speed is different between everything but for now I think this looks good as far as movement yeah yeah okay so now that I have that set um we have it going in this direction now the next thing that I want to take a look at is the cloud technically they're just there and they're not going in the direction of the wind technically they're going to this direction so let's see what we can do to that and okay that's the sky doome to Atmosphere uh uh volumetric clouds okay in the volumetric clouds you'll see there's a wind vector and if you for example increase it you'll see that it will go in a certain direction and the direction I want it to go in is to the left so let's set that to 50 pi and I want to change its color okay and this no that's too much keep it the same okay so now I have the two elements that I want uh the third one that I want to add in here plus the wind is the fog so part of the reason I want to add the fog is because when you're in a storm or when you're in a desert storm or any storm in general you sometimes can't even see like two feet in front of you and I want to give that feeling that sense of like oh crap like this is this is really bad so let's try and change the fog uh let's see so first let's change the color and let's see a bit on the yellowish okay actually let's try no I think that's too much let's try this one for now okay I'm going to increase the flock density to five oh that's too much uh four two [Music] one and the fall off actually let's do five and fall off of one two okay perfect so now I have my fallof uh there we go and let's do a little bit of might fall off like for me right now I just want this to be like an absolute mess when it comes to um like the feeling of wind the feel of everything getting kicked up okay I think that's nice let's keep that for now yeah let's do that I'm going to keep it this way I'm just taking a look at this all right perfect okay next step is the light let's see if we can change that a little bit so I'm just going to change the color and I think I'm just going to keep it the same to be honest I don't think I need to add anything else to it yeah I'm just going to change the color of it CU now everything else has that same color maybe I'm I actually maybe will change the fog because that needs match a bit more so okay no too much okay so now that I've added these two in here you'll see that the ground one kind of disappeared and I want to bring it back so let's go into here and let's see if I change the blend of it a little bit hierarchy so I go to the blend where are you here we go and change that to try point4 okay okay I see that all right so yeah I I tend to try and choose a lot of uh numbers just so I can see like what the difference is okay so now that we have all of this together uh the next thing I'm going to do is add my uh blueprints that I did or not blueprint actually sorry uh it was a material and I added to it um was the mesh but for that I'm actually going to make a blueprint class and do that inside it because I don't want this to be just in the level so I'm going to call this sand underscore um wind okay you go in here add a sphere and just find the camera uh Shader is this one and just add it in here make sure that it's in the right uh orientation so90 and let's add it into the scene it did not add it that's weird oh do sorry I added the actual material that was uh yeah that was funny okay so that is in the wrong [Music] say 90 and here we go now that's in the right orientation okay that is way too much so to fix that now I'm going to actually start changing things so let's go to the wind uh sandial and then I'm going to start slowly changing things just so everything uh gets Blended together and I don't want every anything to overpower anything else so let's start with uh let's see let's start with the sand set that to [Music] one okay set this one to 0.5 and this one to 6 okay doesn't seem so bad okay so now uh that I did this to it I'm going to go back into the uh fog because now that I've added my Shader into it this is going to be an extra layer so now I can't see anything else so I want to change things in there too so let's see okay I'm going to go back into the uh material instance and let's try to add more color in there okay right so let's tie the sand a little bit more let's try 10 and five actually one should be fine it looks much better okay so from this point on is basically just adding things and tweaking things so I'm just going to add one more thing to this to uh give it that extra level of Polish which is going to be a u particle system and I'm going to place them here around this just so it shows that there is a something being kicked up in the wind and that's how you're getting the sand in the air and so on so let's go to the particle system system folder and create our Niagra system uh select from new emitters and the fountain emitter this is would be perfect for this as it's continuously spawn and it's looping so let's call this pscore [Music] sand and save this one okay so for the material uh there is one thing I'm going to add in here I'm going to use uh two previous textures that I've already made and uh one would be the misted uh texture and the other one would be the Moes texture from the Moes uh tutorials and I'm going to add these in here and save them and part of the reason I'm using those two textures is because it combining both of them gives me the illusion of the Mist or the smoke being a bit more sandish like it would have the sand particles in there and I'll explain how to do that in a second uh so I'm going to create the material call this uh mcore sand and dive in here I'm going to add the textures to this okay so part of the reason I didn't use the other uh texture like the sand uh texture for it and I will actually go through it too is two things um when this goes into the engine or the particle system it it gets compressed into one single frame I say compressed but the tiling of it gets to one single frame so when you look at it in terms of just tiling textures and we set this up like 0.0 five and 0.0 5 okay let's make this into 01 or 15 by5 uh start previewing you'll see that this is like the one frame that you're going to get and this is how you do like for example 8 by8 and so on so part of the reason I'm doing it this way is because if I add this on top of it the problem with this one is because it is tiling this is the issue that is going to cause me if I take this for example and add it into the particle system that's the effect that I'm going to get and that's not what I'm looking for I can for example do a u uh radial gradient like something like this uh radial cre an exponential and then multiply it with it to create that effect but I don't want to do that because I already have a texture that already does that for me and let's say I add this to it this is the results that I'm going to get at least for this one I know that there isn't a possibility of it leaking or there be a bug or anything like that uh okay so now that I I've had these two textures added I'm going to do a a text coordinate for the M texture and set it up to be 8 by8 following the actual eight rows and eight columns by the looping smoke and you'll see that it just repeated on all of them and that's what I'm looking for okay so now let's do a multiply and another multiply with a particle color because I want to change the color of these particles inside the engine so let's change it to this and we have this one here and the alpha for this and we do a depth fade and let's set this to 250 we put this into the opacity and [Music] the uh color change this to translucent and voila you have your texture uh make sure it's double-sided and save it and let's take this into the particle system system so if we go into here partical system all right so let's change this into mcore [Music] sand and that's the material that we're going to get first off you can remove the shape and the velocity for now you know what let me bring it back just turn it off and now you'll see that they're just falling uh kill the gravity and the drag and you'll see it here okay let's go into the subv change this into 8 by 8 so you'd have your particles uh set this to Blended uh let's see what's next all right let's set this to like five for now and okay so part of the reason I'm setting the spawn rate to five is because for now I just want it to be Set uh at a low uh emission rate and what I did with the sub image this is where you can change it from being a columns and rows to a just one frame that it can be uh it can be played as an animation so to play that animation you go to the particle spawn and you uh add a sub UV animation so now if we change this into a render Sprite actually I might need to do it in the update y in the update so if you change and if you add this uh subv animation into the update here you can see that is actually moving and having the uh frames play from top to bottom so that looks nice for me for now uh I'll leave that the way it is uh let's see let's add some wind in the particle update wind force and let's see what's wrong fix issue perfect okay so if we add this into the level let's see what it will look like okay couple of things it's going in the wrong direction two it's really small and the color is not right okay so let's zero out so because like this is something that is um in the world I this is how I tend to change my values on everything so let's see if I go into the initial size particle if you go into the Sprite size mode this is where you can change the size for the whole uh this would change the size for that actual emitter and then you add another size module to change it over its lifetime so let's say for example I have uh 50 by 50 so this is what I would get it slowly starts to increase let's say I want it to be a uniform like everything will have the same size and just have it to be super big okay so for now that looks all right next let's add the let's do 1800 next let's change the One Direction to Y and see how far do I need to add it it's going to be in the negative okay that's too much okay all right so one thing that's bothering me about this that it is just popping into existence so to fix that you go to the color scale or scale color and if you take the first uh the first one here into zero you'll see that it disappeared because this controls the alpha so if I add another key in there and then just put this at 05 to have it at the center and then set its value to one you'll see that it's spawning fadily like it fades in and out okay so the next thing is I want to add a size uh let's see scale Sprite size so what this does it actually makes it um SI like it changes its size over its lifetime so let's say for example I wanted to start at um one and basically uh let's see when you set this to one for example right you have your uh when this is set to one the original size that you set here that's the thing that's going to take right anything above one it will be bigger than this and it's O It's overall size but if you add it in a curve it will be something like this for example so this is starts off as the original size and it ends at the original size so let's say for example if we take it up so you see when it starts it's starts at the original size and slowly gets back into a bigger size so let's pick both of these change it into an auto and this is how I would set this up because I wanted to keep its original size for a little bit more and then takes off okay that doesn't seem so bad um maybe if I add it into here here no let's add it here okay so next let's change the color so if you go to the initialize uh article and go to color and here is where you can change it and part of the reason you can actually change it here is because we set a particle color in the Shader there so let's see how this would look like like what I'm trying to do here is just make sure that it's at a good um color that matches everything around it that's doesn't seem to be bad okay now I'm just going to make another copy of it and put it here next to it all right let see force and just add a little bit to the Y AIS and the XA access perfect okay save this and now that's everything together all right now that we got to this point let's see if we can edit everything Al together to try and get a better result than this okay first off I'm just going to check if I can make the density better so make it let's see if we can put it to5 get the fog density down a bit .2 actually this looks really nice three yeah this5 looks nice I'm just going to mess with the color a little bit perfect so now you can see there is a little bit to the clouds a little bit to distance and that's exactly what I want because like if I take this down even more it's not going to be beneficial for me so I still want to see a little bit of detail in the background so for example if I turn off for example sand and I turn off the blueprint I still see that there are things moving around in the level and that's not the only thing that I'm um that I'm counting on to give me that effect so let's go in into the sphere and again when you're doing something like this in the industry or anywhere where you work you're going to have a lot of time to iterate and a lot lot of feedback right so for me when I'm like doing my feedback and like what I'm iterating on things it might look like I'm just doing it out of a whim but to be honest like it's just it's the experience the years and knowing what you like and knowing what other people uh want so yeah so generally I like my scenes to be a bit darker a bit um when it comes to sand for example I want it to be on the the color to be like you're in Anish world that's how I would imagine like being a sandstorm and so on I think if you look at Battlefield one they gave that sense really good so let's see let's change the color a little bit I think just something like this perfect so other than that honestly I don't think I need to change anything else looks good and it doesn't have any issues from what I can see so yeah see frame yeah this is how you set up a sandstorm thank you so much for watching
Info
Channel: Mad VFX
Views: 3,542
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: U0LHmgmLb_o
Channel Id: undefined
Length: 42min 41sec (2561 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.