UE4 - Niagara Ambient FX - Dust / Fireflies

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome to the game dev outpost in this video we're going to talk about niagara and creating a dust ambient effect in unreal 4. now you may also hear this referred to as dust speckles or even fireflies it's a pretty simple effect but it's in just about every game and typically it is just an ambient effect and we usually use it in combination with lighting but it can be used for other things such as gameplay or pulling the attention of the player so with that out of the way to get this started i'm going to right click in my content browser and i'm going to create a niagara emitter from an empty blank template and we'll give it a name n e whatever you want to call it and then we'll open that up so first things first we need to spawn something so in emitter update i'm going to add a spawn rate and i'm going to set this to be 30 and then i'll save and we'll let it compile because now that we're spawning something we can see that we're also spawning all these particles on top of each other and i want to give them a bigger location to spawn in different areas so in particle spawn i'm going to add a location and that location is going to be a box location and in the box size we're going to make this a little bit bigger so in the x it'll be 300 y 300 and z 300 and one second piles you can see that we have this box that they're all spawning in but our particles are a little big so i'm going to come to initialize particle and under sprite attributes the sprite size mode we're going to change this to be random uniform and in here i'll set the min to be 0.75 and then the max i'm actually going to randomize this as well so i'm going to look for random and there's random range float and this is going to be set to be the minimum 1 and the maximum will be 7. we'll just save and then let's take a look at what we have here so we'll play and this isn't too bad now the next thing we're noticing here is that each one of these particles are just popping in and out and now if that's what you want it's totally fine but in my case i want these to fade in and then fade out so i'm going to come to particle update and i'm going to add a scale color and then in the scale alpha i'm going to change this to be a curve so that over time we can fade out but more importantly so we can fade it so right about 0.12 here i'm going to right click and i'm going to add a key i'm actually going to leave that key right there because i don't want these particles to ever be fully opaque so i'm going to select the first key and i'm going to set this to zero so we're fading in and we're fading out and then i'm going to select each one of the keys and i'm going to right click and i'm going to set these to auto so that they smooth out and now if we go and play that we just see that they're fading in and they're fading out pretty cool now if you also wanted some size on this you could do that as well so under particle update since these are sprites i'm going to look for size and you should be able to find scale sprite size and now with this we're going to change the x and y to be uniform so we'll change this into a float and then this float will change into a curve and now we can do the same thing that we did with the color but i think i'll put the key a little further down about here and then i'll set this value to be one and then this first key all set to be zero and then we'll grab each one of these and we'll smooth them out so let's take a look at what we have here now [Music] see they're scaling in getting bigger and then getting smaller and that might be a little much so i think i'm going to add one more key in here so that they can stay in the bigger state a little bit longer set this key to one and then i'll take this one and just move the time down to about here to about the end and we'll take a look at that so they're fading and scaling in and that looks alright now the next thing we can do is we can give these motion and there's actually a lot of different ways to give these motion so the first one is in particle spawn we're going to add velocity and now when you add that velocity it's looking for one of two modules it's looking for solve forces and velocity or apply initial forces i'm going to choose fixed issue for saw forces and velocity once we add that that'll appear in particle update but i'm actually going to grab solve forces and velocity and just put it all the way at the bottom of the hierarchy and now back in add velocity i'm going to change this to be a random vector so if i click on this drop down and just type in random you just see random vector and now once we add that let's go take a look we can go and play this you should see that these are slightly moving it's really hard to tell so we can turn up our vector scale i'll set this as something like five and now if we play should be a little more noticeable you can see that they're just buzzing around just moving that's pretty cool now you can also take add velocity and you can put that in particle update as long as it's above saw forces and velocity but when you add this in here by default you'll notice that these are going to be moving a lot faster right they're zipping around a lot faster now you can just change the vector scale but you also have this evaluation type and this may come down to a performance thing but you can change this from spawn only to every frame now if we take a look at what we have you'll see that they seem a little more lively you know they almost seem like fireflies now so it's up to you how you want to use add velocity in this case you could also use noise modules so if we come up to particle update and we type in noise you can use a vector noise force or a curl noise so if we use the vector noise force and we make sure it's above solve forces and velocity you'll notice that the force amount is set to 200. if we let this play you'll see that this is very similar to that randomized add velocity and you can increase the force amount or you can even randomize this force amount now just the same we can come and add a curl noise and this will just have a little bit of a different effect so we'll just save and let that play and you can see that they're they're moving around they're not as chaotic but if we mess with the strength and we mess with the frequency we can make them a little more chaotic so you definitely have a lot of options for how you want to make these whisp around i'm going to turn off curl noise force and i didn't mind the add velocity with every frame turned on so i'm going to leave it there and now the last thing to do here is to add color so it really depends on the lighting or what you're going for here in this case let's take a look at colorizing these colorizing these for fireflies so an initialized particle i'm going to come to the color mode and i'm going to change this to be a random range and for the minimum i'm going to change this to be a yellow somewhere in the middle here we'll just push this all the way up to full saturation hit okay and then the maximum i'm going to make this somewhere in the orange range with full saturation we'll hit ok you can see that they're all randomized in here which is pretty cool now i want to come to our scale color because i want to randomize the intensity in here so right now we have a vector but i want to just adjust the intensity so i'm going to change this to be a float and then this value i'm going to randomize it so i'm going to click on the drop down i'm going to choose random range float and in here i'll set the minimum to be something like 0.35 and then the maximum will make the maximum something like 60. and now we'll get a whole variety of different fireflies in here and if you wanted you can randomize the maximum even more it's up to you so if you guys thought this video was useful and it helped please let me know by commenting down below and liking the video thanks guys you
Info
Channel: gameDev Outpost
Views: 44,430
Rating: undefined out of 5
Keywords: Get started with Unreal Engine, Unreal Engine 4, Ue4, Getting started with Unreal, GameDev outpost, GameDev, which game engine should i use, Epic Games, indie games, Starting game development, Getting started, Niagara, Unreal 5, 4.26, Introduction, Emitter, System, Curve, Curves, VFX, Blueprint, Parameter, Shape, surface, 4.27, Renderer, Binding, Light, Mesh, Sprite, Ribbon, renderer, GPU, CPU, distance, field, emitter, curve, snow, winter, ambient, falling, curl, noise, vector, velocity, Dust, Fireflies
Id: AGOV-72ytig
Channel Id: undefined
Length: 9min 11sec (551 seconds)
Published: Tue Feb 16 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.