Master Cinematic Fog & Volumetric God Rays in UE5

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in unreal 5 why do I use volumetric fog in every single scene it's because volumetrics and fog are great tools to add depth to your renders and whether you realize it or not Haze and fog are used every single day on set of your favorite Hollywood movies and now I hate this term but a lot of people have asked me how do I make my shots look cinematic and this is one of those key elements that you need in your shots but if you come from Old School VFX so that value metrics come in really noisy and can take a really long time that's where unreal comes to the rescue with fast real-time volumetrics with zero noise and I'm not kidding but there's two big problems one is that the system is kind of hidden and spread out between a bunch of different menus and number two how do you art direct your volumetric to improve the lighting in your shot so today you're going to learn the ins and outs of the volumetric fog system in unreal 5 and how to make your renders look like your favorite Hollywood movies what's up my name is Josh TuneIn for the last eight years I've worked as an artist and supervisor on movies like Star Wars Dungeons and Dragons and most recently across the spider-verse and I've been using Unreal Engine on set and to make animated films of my own and I make these videos because learning Unreal Engine for filmmaking is still really hard and it doesn't have to be so first off we're going to go through all the settings that you need to know to get up and running with volumetric fog now we're going to look at how to Art direct your fog and even change the intensity per light and some tips to improve your lighting and cinematography in your scenes and you're going to want to stick around to the end because I'm going to show you exactly how I created these shots from my upcoming Mr free short film I'll show you how to render volumetrics out in a separate pass and composite them together with some techniques that I use every day working on Hollywood films so here we are in the icvfx sample project this is one of the sample projects I've included in my beginner's roadmap PDF where you can find the best free sample projects to download at every single skill level and this is one of my favorite projects because it's a great intro into photorealism inside of Unreal Engine and I've gone ahead and converted this from baked lighting to Lumen so first things first let's press the quick add actors icon here and we'll go to the visual effects Tab and select exponential hide fog and just drag this into our scene and you're probably thinking well this really didn't do anything in my scene so I probably want to increase the fog density so I'm going to set that to one and it just kind of goes black well first off that's because the fog in scattering color is set to zero but you can see even when we raise that to one it doesn't really do what we'd expect it to do and this is because volumetric fog is actually a completely different tool set inside of unreal but it only exists and can be enabled by having an exponential High fog actor in your scene this is confusing at first but just stay with me so I'm going to reset the fog density back to .02 here and I'm going to scroll down until I can find the volumetric fog checkbox so this is that separate tool set I'm talking about I'm going to enable this and you can see right away we have some really nice looking God rays in our scene so why is that if we take a closer look this is because of our sunlight which is a directional light in our scene so if I enable and disable this light you can see that this is what's causing the god rate so let's take a deeper look inside of the properties of this light and let's just search for volumetrics and you can see we have two options one is the volumetric scattering intensity and the other is cast volumetric Shadow so by using the volumetric scattering intensity we can dial this per light and cheat it brighter or darker but usually it's good to keep this at one by default now because this is the sun it's casting one gigantic directional Ray into our entire world so when I uncheck cast volumetric Shadow it's going to ignore the cave walls and just flood our scene with light and look horribly ugly so let's undo that but we'll come back to this setting when we talk about spotlights in just a minute so now we can rotate our sun around and find a nice composition with our volume rays but the best way to get good looking results out of this is by breaking up the light shafts by having objects occluding our light and creating our own volumetric Shadows but this is looking pretty cool I really like what we have on screen right here but it's getting a little bit blown out on screen left so what can we do to break up our fog well obviously you could just start throwing in different cubes and planes and let's start off with that where we can just make different blockers inside of our scene we can just move this in just a few seconds we can start to block out whatever we don't like so just by tweaking that around here you can see okay we have some pretty interesting shapes here but another way that I like to break up different areas like this is by using a gobo so a gobo is also known as a cookie cutter it's a little stencil that you'll put in front of a practical light fixture to break up the shape and add some interesting Shadows from that light so we can do the same thing in CG so I'm going to create a brand new material really quick and call this m underscore Gobo and this is going to be extremely basic so I'm going to make this two-sided and all I'm going to do is change our blend mode from opaque to mask so now I'm going to bring in a texture sample here I'm going to plug this into our new opacity mask and let's just search for noise there's a lot of default textures that just come with the engine so we have this T noise 01 so now if I preview this as a plane you can see this is our texture and it kind of resembles the idea of a gobo so let's save this out so now let's bring this into our scene let's just create a plane scale this up and we'll drag our Gobo material onto it so now instead of using a giant Cube to block out our light we can drag this through our scene and be a bit more creative with how we want to cut out our light now if we move this out of view of the camera we can go back to our location settings and now we can drag this around and start to dynamically change how our God raiser casts and now we can play around with this all in real time until you're happy with the result which is why I love to use these features inside of unreal but now let's disable our sunlight and look at what we can do with spotlights let's take a closer look at that volumetric shadow now this is really cool gives us a nice swath of light that's not everywhere like we were getting with our directional light but let's see what happens when we turn cast volumetric Shadow on you can see it does start to cast these really nice Galaxy rays and now as we kind of rotate this through our scene or put it behind this different geometry it has some really clean volumetric light so right away people are going to freak out because you can get some pixelated looking fog at first sometimes the quality is not quite there but it's actually really simple to adjust if you ever need to increase the quality settings of your light rays you're gonna have to use the command variables all you have to do is go to your output log where you can enter in some command variables and type in r dot volumetriclog dot grid pixel size so if we type in any command and just throw in a question mark after it you can see what the setting currently is inside of the scene so here our grid pixel size is set to 16. so how this works is all of the fog in the scene is basically a grid of voxels or 3D picks pixels where there's pixels going in X Y and Z so if you want to increase the resolution we actually want to make each one of our voxels smaller so we want to decrease this to increase the resolution so the smaller the size of each grid pixel the higher resolution we will have so if we type in r dot volumetric bog.red pixel size and it set this to four this is going to give us a much much cleaner result now we can go even smaller than that and go all the way to two and we get some really crisp really detailed voxels here if you're not careful this can really start to fry your GPU so if you're ever worried about pushing this too far if you just type in stat GPU you'll get all of the different things calculating in your scene at a given time and if we look here we can see it takes 0.27 milliseconds to render volumetric fog in your scene so when you say it's real time it really is real time let's increase our resolution here let's set it to something like two which is very high resolution you'll see that this volumetric fog is going to start climbing up here it's become the most expensive thing inside of our scene it's actually going to take six milliseconds per frame which again is still much cheaper than any sort of offline renderer but if you have a lot of things going on a lot of lights that are casting Shadows inside your scene it'll very quickly start to fry your GPU so I like to set this to four by default usually this gives us a good trade-off between quality and performance and you can always increase this inside of the movie render queue settings so before we move on here are the last four settings you need to know so you can art direct your fog you can tint the Albedo of your smoke although very quickly this starts to get into an unrealistic territory so I almost never do this typically it's going to be a much better idea to just grade your footage after the fact and the same goes for extinction scale if you set this up higher it'll make your God Rays more apparent but epic has done a few job of all these defaults being fairly true to life so the more you can keep close to the default values the more accurate your lighting is going to look but it is worth noting our exponential height fog setting have an effect on our volumetric fog so we change the density here it's also going to change our volumetric fog and if we look at the fog height fall off if we increase this it'll keep most of the fog localized towards the ground for aesthetic reasons can look good but in the case of God Rays they should be the brightest closest to the light source which is going to be towards the sky and just be very intentional about when you want to change these and get away from the default setting and now the last feature that I want to talk about that I haven't really seen discussed elsewhere is that you can actually have fog in your materials so I'm going to add this sphere into our scene and right now it just has the default material but I've built this volume fog material that if I apply here is actually going to change our sphere into fog so so depending on where I move this it's actually going to contribute into our voxel grid of volumetrics as we drag this sphere across our scene it's going to create localized fog we can make this really small and keep it in these little pockets or we can make it really big and fill up our scene so if you want to download this material so you can just drag it into your own scenes I'll include a download link for free in the description on unrealperviewfx.com let me open up this material and let's take a closer look so to create a fog material instead of our default surface material domain we have to change it to a volume and we're going to change the blend mode to additive this is going to give us the extinction option in our material which changes how light will pass through our material so the basic component of any fog material are going to be a sphere mask a sphere mask is just a mask in 3D and this is the guts of what's actually going on and driving everything here and if you want to get crazy with it you can also add in some noise breakup by using this noise node so if I preview this noise we'll see all I'm doing here is I'm taking a Time input using that and adding it to the world position so now we have this animated 3D noise which is basically a noise that's just moving through the world and now once our sunlight is shining through this we get some really crisp God Rays with this 3D noise animating through it which gives us a lot of life and movement so now you should understand exactly how volumetric fog works but now let's take a look at a couple different creative examples on how you can art direct your fog to change the lighting and cinematography of your own scenes so I created this scene from a one hour environment challenge at last year's siggraph where we had one hour to create an environment from nothing but quicksil assets and I took advantage of the volumetric fog system so this entire scene is made from just four different qixel assets and just trying to reuse them and create an interesting composition out of this parallel mirror Dimension type world but let's take a closer look at how the volumetrics are set up but in this interior scene it's the same as we had before where we have this exponential height fog I left the fog density at .02 and then if I look at any one of these spotlights you can see that I've just cranked up the volumetric scattering intensity to 10. and looking back at this project one thing I didn't even realize when you add a new Spotlight into your scene the cast volumetric Shadow is actually turned off by default so if you look through here if I just crank this volumetric scattering intensity it'll actually just clip through objects so when I bring this through our wall here we can see that it actually just Clips right through but you have to check this to true to make sure that everything calculates correctly another thing worth noting here with spotlights let me turn this scattering intensity to something crazy like 60 so we can really start to see this one thing that I like to do a lot with spotlights is change this outer cone angle to something really small like 20. it's really focus in that beam of light if I aim this at the ground you'll see we'll actually get a really bright beam of light but our volumetric intensity doesn't quite scale with that so if I made this bigger you'll need to make sure that you have a wide enough coat angle where you're affecting enough voxels in the volumetric grid for it to show up correctly in your scene but hopefully this scene gives you a really good idea of how you can take different lights move them around and change their angles and the way they're projected to give you really strong light Direction and a sense of composition in your scenes and if I toggled on and off the volumetrics in this shot you can see how big of a difference it makes in a dramatic scene just like this all right now let's step up our game one more level and I'll show you how to render out your volumetrics separately so that you can composite them together with some Hollywood level VFX techniques that I'll show you in nuke in just a second so I have this scene from this Mr Freeze short film that I'm putting together and we have his wife Nora here and the idea is to put her inside of this cryogenic ice chamber but having materials that are refractive like ice are really hard to get out of any render engine quickly so the fastest way in my opinion is going to be rendering out a couple of different aovs so that we can assemble everything together in comp so I have my volume light here that I can just toggle on and off so to render out our volumetrics I'm actually going to have to render this out in three different passes the first one is going to be just disabling this volumetric light entirely so we're gonna just disable this from the scene to make sure that a light doesn't show up inside of movie render queue you have to make sure that you uncheck either effects world or visible just hiding it here in the outliner is not going to hide it from a movie render QR I'm gonna render up with our path tracing settings here after that I'm going to enable this volume light and I'm actually going to disable all of the other lights in our scene so I have a preset that I made here after testing out some settings but the main thing you'll want to do when rendering up volumetrics is you'll want to crank your spatial sample count and increase your temporal sample count until at least four I'll just be a little bit of micro flickering if you don't use these settings so now we want to render out two different passes just go up to the add settings button and add a lighting only pass and a detailed lighting pass and you'll understand why when we get to the composite so now we'll render that out of movie render queue and one last thing to know if you've animated a camera in unreal you can just right click that camera inside of sequencer and go to export and then you can export that as an fbx file which I've kind of done for all of these cameras already after making this project I found some really nice ways to render out aovs and good movie render cue configs so comment down below if you want me to cover that in a future video now we have our render here in Nuke I just went ahead and added a nice to focus to it with a nice anamorphic kernel now we have a photographic quality to some of our spec kits and things like that but now let's go to our volumetric render so I'm just shuffling out our two passes our detail lighting and our lighting only passes and if we take a look at this our volumetric detail lighting pass it has our volumetrics but it also has the light that's cast onto our skin the diffuse lighting so the lighting only pass isolates that diffuse light on her and through a really simple operation of just subtracting this from the other we're just taking this image and subtracting it from our volume image we'll get a clean render where the volumetrics are isolated by themselves and when compositing I always always try to use live action footage in one way or another so a really cool thing we can do is combine our volumetrics with live action footage so I'm just multiplying this by this Ling lingering fog element so here I've imported my camera I've taken this video clip and just put it on an image plane in 3D space so that it tracks to the motion of the original camera and now by combining these two renders together we have a really unique photo realistic pass that we can now combine with our path traced Beauty render and have believable volumetrics in our scene and if you render out a depth pass you can also get even more creative and precise by wrapping different steam elements around your footage based on the depth of the shot itself so even if you didn't get exactly what you wanted out of the volumetrics you could use a technique like this to wrap different stock elements around your scene in a really believable way and here's a look at the finished renders so I hope this opened your mind to the possibilities of aov's volumetrics and why I use Unreal Engine so do me a favor leave a like if you learned something new And subscribe to the channel if you want to learn more we just wrapped a music video for the band Tesseract where we did five minutes of a samurai sword fight animation doing motion capture ourselves and creating everything in engine and I can't wait to share more of my filmmaking Journey inside of unreal
Info
Channel: Josh Toonen
Views: 72,318
Rating: undefined out of 5
Keywords:
Id: Kjg6kCW2BtY
Channel Id: undefined
Length: 17min 43sec (1063 seconds)
Published: Thu May 18 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.