UE4 - Tutorial - Rain Particles [Cascade] (Update)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys and gals and welcome to a new tutorial in today's video we are going to be going back to the very first tutorial I ever made on the channel Lulu and remaking it with some up-to-date information and obviously a better sound because that was back when I was using a crappy little laptop to record all this stuff you're not going to need any additional files for this however if you would just like to download the particle system directly you can support me on patreon and you will get access to the files that we create in this tutorial now what we're going to be doing is we're just going to be creating a simple material and then we're going to be creating our particle system and I'm going to run through some of the reasons we're doing what we're doing with the particle system and then tell you different ways that we can have this system optimized depending on the way that we handle a collision so just get rid of these lovely particles goodbye particles they go on so we're gonna right-click and we're gonna select material and we're just going to call this brain underscore m and we're going to open this up what we're going to do is before we add any data here we're just going to change our blend mode to translucent and our shading model to unlit we don't want shadows to affect our reign as its falling and we want to be able to see through these things if we choose to do so first thing we'll bring in is a particle color and what this will allow us to do is will allow us to change the color of our particles inside of our cascade system as well as its alpha now we're just gonna plug at color pin directly into a miss of color because that's all we need we just need a color for these I'd say this is gonna be a really simple material we're gonna right-click and we're going to search for a radial gradient exponential and what this essentially will do if we just start previewing this is it just creates a really soft kind of dot or circle force and we're going to be using this as a mask you can see here you have a nice faded white into a black and on a plane which is what our particles will use by default we get this nice softer edge so they don't look very sharp we'll just stop proving it and to use this we're not gonna plug it directly into the opacity because we need to be able to change this inside of our particle system we're just going to hold em and left-click for a multiply and we will take the Alpha pin from our particle system our particle color rather and multiply the radial gradient by this and plug that into the opacity and now we'll be able to change how see-through our rain is inside of our particle system we're just going to hit apply and we will close this down now we'll build the particle system we're going to right click and we're going to select particle system and we'll call this brand underscore P now what we're going to do is we're just going to drag this into our world and you're just see we'd get some them at default particles we open this up there we go we get the default particles which just like this little crosshair we're going to change all this around so first thing I'm just gonna change our background color up just a little bit this is a little bit lighter like so and what we're going to do first is we're going to bring in our material to do so we click on the required under our emitter and when you now have our material available on the left just going to drag our a material into the material and let go while it compiles that we are just going to see regular planes with nothing on them don't worry about it it will catch up and it will update itself before you the next thing that we're going to do is because we want to have quite a lot of rain we're going to be moving our particles to render on the GPU by default our particles render on the CPU and to have more particles and have them more smooth in our scene we need them to render on the GPU instead so to do this we're just going to right click type data new GPU sprites now you're going to get a little error it says that we don't have a bounding box don't worry about this yet we're going to make the entire particle and then we'll make the bounding box afterwards and what the bounding box does is it basically shows us the area where our camera will be able to see our particles if your camera's not looking at a bounding box the particles won't spawn and they won't be rendered if you are looking at the bounding box then you'll be able to see them the reason we're going to change this later is because right now our bounding boxes can be very very small to this area so if we add a reign over a larger area later obviously we'd have to be looking at this point because this is where our bounding boxes otherwise our reign won't render before we get to that we actually have to make the entire area that's going to contain our rain so the first thing we'll do is right now this isn't very rain like this is more like a little wispy smokey thing we needed to be heading downwards and we'll do this using initial velocities four hits and initial velocity and in that maximum min we're just going to change these air value to negative 500 and this will spray them downwards we now these are going to be quite big if we were to look inside of that level here and let's lift this up instead of just fly away you can see there's a quite large compared to our little player what we're going to do is we're just going to shrink them down in our initial size just going to change to a distribution vector uniform in fact a vector constant rather and we're just going to set these two three and now all of our particles will be same size and then much smaller than they were before so we have our velocity and we have our size and color we're not going to mess with that right away we're going to do that afterwards a lifetime however we're going to just up the lifetime to maybe five like so because we want these to last quite a while because they're gonna be falling from the sky and we don't want them to disappear before they ever reach the ground we're using GPU sprites as we've set this up already and our spawn is currently only spawning 20 of these guys what we're going to do is we're just going to up this number to maybe 200 and this would give us a nice light rain right now it's going to look a bit like just to spray because we're still just coming out we're still just boiling these at a singular point to change that what we're going to do is right click and then we're going to head to location initial location and by default our start location is going to be a vector uniform which will give us essentially all three have our axes to work with we're going to be changing our X to 500 our Y to 500 and I can see this giving us a nice box but it's giving us a box with our origin in the corner we can see here we're going 500 and 500 but we want our box to be surrounding this origin point just so that we can use our little board here to let us know where our particles are going to be when they're inside of our level so we're going to add negative 500 to both the X and the y now if we were to check you can see that our little board here is in the middle of our particle system you can see there that's the bounds working you see they turn off if I'm not looking at it or fix at afterwards now we're going to just place this particle system back down on the ground we're going to set the initial location Zed to 1000 and now change this I got 1,000 and now this will spawn our particles way up in the sky now we have the entire area that we're going to be spoiling these from at the top under balance we're just going to click this little drop down and we're going to set fixed bounds and if we click pounds you'll be able to see this nice big blue and yellow area and this is where our camera can be looking - born these guys if I was to raise this up like before if I was to move my camera so they can no longer see the emitter you can see we can still render the particles it's ground so what we're going to do now because these are little dots that look more like snow what we're going to do is we're just going to right click and we're going to say size by speed and we're going to increase our speed scale to five on both x and y and maximum scale we're going to say 0.3 on X and 5 on Y and now you can see we get these nice long articles it looks a bit more like rain the problem we have now though is it's just falling straight down and if we were to look up you can see they turn sideways like spaghetti so to stop that we're going to right click orientation luck axis and we don't want them to rotate on this edge so we're going to lock rotated now if we look up you can see they still face straight down there's a problem that we're going to currently have is these are currently just falling straight down in a line but imagine if they had wind so if we go to our initial velocity in fact we'll right-click add an acceleration and a constant acceleration and we'll say minus 100 on this edge so they get faster that longer they fall and we'll add wind here as well so let's say we say 500 on our acceleration in the eggs they will now get pushed sideways but they're still going to face downwards the reason they're going to face downwards is because n are required a screen alignment is PS a square it's always going to keep them square and it's always going to face the same way depending on where our camera is we're going to change this to PSA velocity and now it will align them based on their velocity and you can see that lovely rain will now go sideways if we add a sideways acceleration we're just going to set this back to 0 for now just so they fall straight down but we now have the option if we wanted to say 1,000 to really blow them in some wind like so pretty cool so we have our constant acceleration the thing we need to do now is we need to add our collision if we were to come into our little level here and we select a particle system so we can see them all highlighted in orange you can see here that they're falling through our floor we don't want that we want them to actually disappear when they collide with something so this way we can have our rain disappear if we're indoors and reappear for outdoors we're gonna right-click and we're gonna head to collision and we're gonna set just a collision if we select this now you can see our response here is bounce on the scene depth so if we were to look here you can see the Iranians bouncing upwards now this is where I'm going to talk to you about some optimization things and the different ways that we can set our reign up by default GPU sprites use our scene depth to decide what to do if we were to change response to kill then when our little particles here collide or something you can see that the orange whereas particles are currently at disappears as soon as it hits our ground if we go underneath our ground like so you can see that it still disappears however because we're using seem debt scene depth rather if we cannot see the object that is being collided with they won't collide because that objects not getting drawn a GPU isn't going to collide our particles similarly if we're inside the object here you can see they're just going to fall straight through and this is where you have a decision to make over which sort of collision that you want to use by default they are going to be using the scene depth and as I say if you can't see the object then our particles won't collide if we were to drag this upwards like so we can't see them so they're not colliding they're coming straight through if we can see it you can see now our particles no longer are coming through here okay with that and you're not planning to have any indoors area screen at scene depth is gonna work perfectly fine for you however if you want this to work while you're in an indoors area we're going to be changing our collision mode to distance field and what distance field is going to do is it's going to allow us to have a pre-baked areas from all of that meshes throughout lighting have the collision data constantly available whether or not we're currently looking at our particles if we change it to distance field you're going to have to change your render settings we're going to head to edit and we're going to go to project settings and under render or rendering rather we're gonna search for mesh distance fields and we're going to turn this on by default this is turned off when you turn this on it is gonna restart your engine and depending on how many different shaders you currently have it might take a little while to reopen don't worry about it if it gets a little bit stuck it is going to reopen it just needs to realign all of the shaders for you once that Sun you'll be able to go ahead and see the rain no longer falls through our ground even if we can't see the object a train is sliding and dying as it should do because now we're using a pre-baked set of data we don't want to duplicate look let's raise up floor here if we were is this up it's like a roof you can see now we're not getting any rain inside but we are getting our rain on the outside or other we would if the rain that spawned above where we just place that oh yeah you can see our rain no longer goes on to the inside here but it is outside and that's how we can optimize our rain obviously that's going to be project dependent if you need indoors and rain outdoors then setting that up is the easiest way you have your rain collide and respond to your meshes correctly now we can open this up and we can go ahead and we can say spawn we can really crank these numbers up because they're working on the GPU obviously as with all things you want to work in moderation one thing that you can do to obviously make these things look a little bit yeah well to talk to my C's a little bit more especially if you're making a single-player game is to just attach the the particle system that to your character so the rain always moves with it that way you don't need to cover a larger area and you can use less particles and it's going to be a little bit more effective and at less expensive to render obviously depending on how heavy you want your rain just change the amount that you're currently spawning we'll save that we'll just get rid of this little roof here one of the things that we can quickly do is we can open up our Aryan particle right now we're using color of a life which is kind of a waste we're just going to delete this out and you're gonna see that your particles will disappear what we're going to do is right-click head to color and just give them an initial color by default that will be set to white with an alpha of 1 which is exactly what we just had and we can maybe change this to be a slightly lighter blue and give it a lower alpha just so that it's hinted a little bit more there we go a bit more subtle and we can see through it a little bit quicker and it just gives it a bit more of a notation they feel heavier towards the camera you can see here they're much more visible towards Cameron further away they're less pronounced so there we go guys yay updated rain Mahalo cool system it's been a while since we've done rain but there we are that's it in cascade I do plan on also doing a video on how to set this up inside of Niagara as well for those of you that are making the switch to the new Niagara systems thank you very much for watching I'll see you guys next time bye bye
Info
Channel: Dean Ashford
Views: 42,806
Rating: undefined out of 5
Keywords: Games, Video Games, Gaming, Gamer, Lets Play, PC, Console, play, playing, player, play through, play guide, guide, game guide, dean ashford, dean, ashford, UE4, Unreal Engine, Tutorial, Teaching, Teacher, student, indie, dev, developer, development, rain, particle, system, cascade
Id: KagvDQbkSHk
Channel Id: undefined
Length: 15min 30sec (930 seconds)
Published: Wed May 15 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.