Join Craig Barr for an in-depth discussion in this video Creating ambient particles: fog, part of Unreal Essential Training.
- When working with Unreal Engine 4, it's possible to really bring your scene or your overall level to life with a bunch of different effects. One of the things that we want to do now is really start to fill in this background of this overall atmosphere with some other effects. This is where we can apply a simple atmospheric fog to our scene. So you can see that we have our ocean water, it's looking really great, and we have our foliage and we actually have some ambient wind kind of driving those grasses down there and the trees up here as well. But we can see that the water plane, or the ocean for that matter, doesn't really fill in in the entire environment.
It's actually not a problem, because we're going to be focusing on, our main kind of area of interest for this project is down in here anyways. But we can fill in that background or this overall global area with some atmospherics to add some dynamics to this scene. Now, the way we're going to do this is we're going to simply come into the Modes menu and click on Visual Effects. And if we just dragged this out just to show what we have here, you'll see that there are actually two different fogs available within Unreal Engine 4. I'm going to describe the difference between the two of them here.
Atmospheric Fog, if I just drag that into my scene just so we can illustrate it here, is simply just a global fog that's going to provide distance and light scattering effects of the fog within the atmosphere. And just really quickly I'm going to show how we can get the overall density of this dialed in here. So you can see on the side here I have Atmospheric Fog, and let's bring this Details panel up a little bit, and we have in here Atmosphere. This is where we're going to dial in the overall density or the appearance of that fog.
I should point out, it really doesn't matter where the fog icon is. But just a little tip: you may want to keep it somewhere within your main view, so if you need to select it in the view port anytime to dial in anything, it's quick and easy to find. It's just a good way to have it, rather than way out in space and you don't know where it is. Of course, you can always come back to the World Outliner to find it in here as well. So what I want to do is actually create the overall density of this fog. So could start to bring in things like Fog Multiplier, and you see in the scene how that's affecting things right there.
We're getting things like there's really kind of dense fog effect. The important thing to note when dialing this in is that we're outside of our main assets. It's going to appear different when we get back inside here. So if I zoom in, we're going to see that our scene actually looks pretty good here. But we do want to dial the fog in pretty much to the perspective of where we're working with, or our main kind of hero area. So I just click a Rock and hit "F" just to kind of frame in. This kind of representative of where a lot of the different camera movements are happening within our scene.
So we may want to work in this space, just hit "Esc" to select nothing there. And this is where we could start to dial in the Atmospheric Fog. We can get into things like a Density Multiplier, which is essentially doing exactly that, it's multiplying that overall fog density. And then we can get into things like the distance or how far that fall off is. If you look towards the sun, we can see that it is falling off quite a bit here, but we're also seeing that the light effect is having this nice kind of light scattering effect throughout the fog here. And we can adjust that as to how the brightness is affecting the overall fog.
And we can change even the default light color. If we wanted to change how the light is interacting with the scene, we can start to dial in maybe a different color as to how the light is breaking up overall our fog in this scene. Now, I didn't want to spend too much time on this fog here because we're going to take a look at a different fog, which is actually maybe a little bit more of an advanced fog as to how it works for the scene. And I think the other fog is actually going to work a lot better for this scene, as well anyways. So, now that we're seen the basics of that, this is something you could use as a global overall atmosphere fog that just kind of has a nice distance effect to it and really kind of pulls out a lot of the environment here.
And we can see that if I zoom back out, we have this really dense fog and it is kind of filling in a lot of the background elements in there. Well, that's fine and everything, but we want to use something that has a little bit more control over it, or a little bit more of a dynamic effect to it. We're going to select that Atmospheric Fog and just right click and go to Edit and hit Delete, we could use the ''Delete'' hotkey to do that as well, we'll remove that fog. Now we want to take a look at Exponential Height Fog. Now, this fog is really interesting. We just drag this into the scene.
In my opinion, you're going to get right away visually something that looks a lot better. What Exponential Height Fog is doing, the basics are that the lower the height within the environment the more dense the fog will be. The higher the height the more it will actually open up. So you can think of this as what you would typically see when in autumn forest walk if you're walking through a forest on a cold morning, for example, you could see this fog that is sitting more densely packed towards the ground, and it seems to dissipate at times up with the height.
Now, this is where we want to dial this in to really give us this kind of overall law hanging kind of fog effect. And you can see in the distance it definitely already looks a lot better, in my opinion, than what we had in the previous general atmospheric fog. So I just hit my "S" + Right Mouse Button, and just kind of zoom out just to kind of get a global feel of what we're working with here. We're going to see that the differences when we get down low, that this fog is giving us this kind of overall feel of a little bit more of fog down towards the ground.
And we can see that by just kind of tumbling around on our scene looking out, we can see that we have this feeling of fog kind of coming up through the trees there too. So let's adjust this setting in here. So we have our Exponential Height Fog selected. The default Fog Inscattering Color is this off blue. We're going to leave it as that because I think it kind of works for our scene. This is where we can adjust our fog density. You can see the default looks pretty good, but we are in an ocean scene, so we may want to kind of bring that up a little bit, so we may want to fill in our environment with a little bit more of that density with that fog.
So it's probably where we want to zoom in and kind of be from our camera perspective again to adjust these things. So the fog height fell off, this is interesting, this actually relates to how dense it's going to be at lower levels. So the lower the level or the height of the ground the more dense the fog will be. And then this adjusts how that fog density will fall out from the low points of the ground up as height continues in there. So we can set our maximum opacity of the fog, which is actually here at one.
We could dial that back if we didn't want that fog to be overly dense. So you can see that as I just gently bring that down, we can adjust that opacity in there as well. So we can adjust the Start Distance of this, so if we didn't want our fog to begin right here towards the camera, which it is by default, we could adjust this back and you see that fall off back into the forest. I kind of like the idea of it being in this foreground here. So we'll leave that as this as well. Now, our Fog Density here, if we increase this height you see what's happening to the sky here, this fog height fell off.
It's going to be very dense towards the ground and really light up here, the fall off of this is actually much more sharp, it falls off more quickly the higher I dial that up. We want to go somewhere kind of in the middle here, or maybe something like that. so that the fall off does happen right up these trees as well. Now what we can do is work with our Directional Inscattering. This is affecting the view of how the light is interacting with our fog in our view port. We might want to change that color, something to maybe give it kind of a bit of a mood, something maybe along the lines of kind of, maybe something like an off red in here, that's fine.
So we can start to kind of dial in the overall effect of that, this is that value for the inscatterning of the light that we can essentially adjust. I'm not going to get too deep into that, because I think the fog effect that we have for what we want in this scene is going to work out well, before we start to apply some other effects in here as well. Now, of course, do we want this fog visible? We absolutely do, there is the parameter flag to turn that on and off. So you can hard-wire that in if you had a scene where you wanted to be able to turn that on and off. But now we can start to see that our scene is really starting to look a lot better, it's stating to come to life here.
Just inadvertently duplicated that, I don't want to have two fogs in here, so I'll just delete that one out. But we can see that overall our scene is really starting to come to life. We really have something that's starting to look a little more dynamic, a little more life-like here as well, with this kind of low lying fog and our nice little ocean effects in here. So using fog effects in your scene will definitely bring things to life a little more, it kind of fills in that ambient space, and makes everything look just a little bit more dynamic, and gives you that kind of nice overall effect of a scene that has some atmosphere to it.
- Customizing the Unreal UI
- Creating a new project
- Creating landscapes
- Blocking out levels
- Assembling a scene
- Working with materials and lights
- Adding post-processing effects
- Defining bodies of water
- Adding atmospherics, foliage, and wind
- Working with the Blueprint editor
- Creating cinematics
- Monitoring performance
- Packaging a game for distribution