How to... Localized Volumetric Fog in Unreal Engine 5

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
foreign volumetric fog that is localized so in here I've got my game mimic that is currently in development and I've got this room here for our Greenhouse room and I chose the room because it's got some light sources in here that it best shows this off so volumetric fog is a setting you'll find in your exponential height fog actor you just go down you'll find volumetric fog turn that on and you can see the voxels that make up the volumetric fog light up with our light sources uh but this is applied to the whole entire map so you may not want this to a player absolutely everywhere um you may want to control how much gets applied everywhere okay so you've got a few settings first of all that we want to tweak before we continue um we're going to change the scattering distribution so scan distribution it handles how much light is scattered in different directions when it hits uh the volume volumetric uh fog voxels so if I increase the number up it will scatter so much that eventually comes to a single point and if I go this way go down you see it scatters and spreads out so much it becomes like thin okay well we can also type it in the number here too so it would be minus three for example uh volumetric fog points are now even tighter so you look very very little distribution and again I can go into here in top in three in this one and they are now very so scattered that is scattering across like a large area of the map you can see the sort of light bending around it kind of looks kind of broken so here we've got this going on here now what I want to do is I want to turn it down enough so I don't see this volumetric fog but also um still have it turned on so I've got a fog density here I can turn this down and that will allow that to not work as we want it to because if I turn this up to maximum here even though 0.05 it still looks pretty good okay so what I'm going to use is volumetric material so I'm going to create a new material and we'll do volumetric fog and open this up and the volumetric fog material we're going to make is really simple all you're going to do is go into the mature domain change it from surface to volume and you're going to see it now change to an Albedo it there's a massive coconut to Glow Extinction and ambient occlusion and what we're going to do is put in a color for the Albedo so we're going to go into here plug that in and we'll just choose a color which is white for example and it must have not missed a Extinction I'm putting a value of one now you'll see error saying volume materials must be using an additive blend mode so just go to your blend mode where it says opaque and change that to additive this is because it's been added on top of the scene that is underneath it now the preview is not going to show anything that's totally fine that's expected and we'll save that and what we'll do now is just drag in any shape so let's drag in our Cube here and I'm going to give it that volumetric fog material and you can see here now we've got a foggy sort of cube and we can use this to sort of add volumetric fog in very specific areas so if I want it just to affect just the floor of our scene we can do okay it's that sort of low hanging fog effect which is pretty neat so if I were to push play here you can see this in action and you can see how like it's not foggy up here but it's foggy down there I'll go down here like that oh I forgot to turn off the Collision I can walk on top of it hang up go in here let's change Collision to have different preset to no Collision there we go right and let's go back up here again push play okay so I've got no fog up here but if I go down here we can now walk amongst the fog so it's a really cool effect to add localized fog to a scene now keep in mind this only really works for boxy shapes um for example if I were to put in a big sphere instead like this and apply the same material to that it'll still look cube-like now the reason why it does that is because it's the volumetric fog is handled by voxels which are Cube shaped so you can't do anything round with it there are ways around it uh which I can go through in another video but just be aware that anything around won't come through as round as you'd hope it to be so if you're limited to boxy like shapes just because the way the voxels work um until I go through and show you the video of how to do it with circle shapes but there you go it's a pretty neat effect to create a very simple um really nice dense fog that you want to use now so you can change its opacity and things like that by messing around with the material and as I did we're just using white here so the color from the lights are lighting up nicely so we've got a nice orange light lighting up um but yeah we can go into that number two and and tweak that as you wish really so if you wanted to miss a bit of Extinction you can do let's change that value to 0.5 for example show you what that does so you can see it's less thick okay um if that's almost gone completely in this case um so you can tweak around that number there get different values different effects 0.8 yeah so it's Extinction I think it's based upon distance aren't they uh yeah there you go so yeah it just changes the thickness of it basically um let's change it back down to 0.2 0.3 and wait for it to kick in just push play actually I might be a better way of doing it there you go so 0.3 it's less thick we can see the floor a bit now um yeah it's a good good effect there they go if you like this how-to I want to see more how-to videos in the future head over to patreon.com forward slash Ryan Laney where you can find all my videos early before anyone else from just one dollar a month thank you to all my patrons and YouTube members for the continued support and I'll see you all next time bye everyone [Music]
Info
Channel: Ryan Laley
Views: 23,416
Rating: undefined out of 5
Keywords:
Id: IWGujvx6sSg
Channel Id: undefined
Length: 8min 1sec (481 seconds)
Published: Thu Jun 01 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.