PATH TRACER Explained - Unreal Engine's Underrated Tool

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
This video is sponsored by Skillshare. Hey, everyone. It's great to see you again. It's been a while since my last video, but it's good to be back. I hope you had a great summer. Now. The topic of today's video is going to be all about the new and improved path tracer in. Four point 27 that just released not too long ago. Now, previously the Patriots are had a number of limitation. It was much slower and it didn't support the vast majority of material type like subsurface, scattering, translucency skies, so on and so forth. Now, although features are mostly supported and it's amazing pass rates are rendered what we call a ground truth image. So this is similar to offline render Ruth like V-Ray and Arnold. It works by casting lots of rays into our scene together information about light and color to shade, a given pixel. It includes feature, complete materials within reflections and refractions, super sampled anti-aliasing and approximate of caustics, which is totally new, but why he was at at all. What's the point it's slow. It's not real time. It kind of defeat the purpose of using unreal. The path tracer is extremely useful. When you want to compare your real time lighting with a fully path rate renderer pass tracer don't lie. They're not approximation of what light should do. They are physically accurate giving you much, much better result, much better shadows. So much more detail. You can then use this to measure the quality of your real time rendering and make adjustments from there. So for me, coming from a VFX background, Beyond excited to start working with the path tracer again, I think this is an addition that makes unreal insanely powerful, but you might be wondering, well, what's this path tracing thing. And video had been trying to sell us on the RTX and Ray tracing stuff. What's the difference. They are more or less completely interchangeable terms we could nit pick about how Ray tracing is a bit more of a general term at the poet, the passenger. But outside the people writing render engines, I doubt that definition difference matters. So in order to enable it and get it running your engine, you need to make sure that you have Ray tracing enabled in your project. This is a must, there's no way around it. So in order to enable Rachel thing on our project, we need to click on the settings button up top. Then click on project settings, and you're going to scroll down to the side where it says platforms, windows, click on the window button and where it says default RHI. We need to make sure that this is set to direct X 12 and the next step and the search detailed panel up top. We can click here and type Ray tracing and you'll need to make sure that Ray tracing is turned on. Now, when you click on this here, a window will pop up, asking you to enable the support compute skin cash options. Click. Yes, you're going to need this as well. Once that's done, you can restart the engine and you'll be ready to go. Now we're ready to jump into how to use the path tracer and all of its settings. So now the best part about the path tracer is you can. Turn it on without having to do anything else in your scene, you don't need to change your materials. You don't need to do anything else to what we're going to do is we're going to go to the button up top here and switch just to pet tray thing. Now be careful things are going to slow down considerably and this video will actually get pretty choppy when I click it. So I'm going to turn this on right here. And you'll notice that it's now starting to do its thing. It's slowly calculating our samples. Our image is getting progressively better and better, but now you might realize that's just one frame. If I turn the camera rotate around, you'll see, oh, this does not look so good. This is really slow. Especially if you're used to, you know, working in real time, this is a real pain to work with. So all of our path tracing settings are controlled through post process volume right here. And in the detailed panel, we're going to search for path and you'll see right here, we have samples per pixel, 16,384. For the sake of the video, I'm going to turn this back down to 10. And because we have the de-noise or enabled right down here, pay attention to what happens when I hit enter. Now, poof, everything is back to normal. Everything kind of de-noise now what happened? Why is it so fast now? Why is it such a clean image? That's because as soon as the 10 samples here have finished calculating the de-noise where it's going to kick in, whereas previously it had to finish the 16,384 samples before being de-noise. That's a lot of samples. It's going to take a very long time. So for previewing purposes, it's often easiest to just tone down your sample counts so that you can get it easier, quicker, faster, better preview. But now we have a series of things that are just plain wrong with our scene here. The first of which being our image is very splotchy is kind of ma like we, we've lost a lot of fine detail, especially on the wood floor here. If I switch this back to. Okay. Notice how we had a whole bunch of like gritty texture. Like if we have a lot of grime, there, there was lots and lots of details. But switching to the path, tracer, everything is kind of mushy. It's kind of muddy. What's happening. That's because of the denoiser, the denoiser is incredibly aggressive. And honestly, if you want the absolute Crispus sharpest best possible result with the past tracer. You're going to need more samples. There's really no way around that. You're not going to be able to get the Crispus best possible render with low samples and a Detroiter. Now, there is a very useful console command that you can use to give you a progress bar of the rendering process. So opening up the console command menu at the bottom, I'm going to enter our dot path tracing dot progress and display one. And by hitting enter. Now when I moved to camera and you'll see, we have a progress bar at the bottom. This is super useful for just getting an idea how much longer you need to wait before the render is complete. If I create the sample up to 500, now the progress is going much slower, but it's really nice to know how much longer do I really need to ways. So jumping into Photoshop real quick, we have two renders here. So one would rendered with 10 samples. Plus the Dean razor and the other one on the right hand side here, what rendered with 500 samples with the Dino laser. So at first glance, especially on a compressed video on YouTube, they may actually look pretty identical. You might not be able to tell them apart, but the moment you start zooming. You'll notice that the version with 10 samples really starts falling apart. So right here on the base plate, the kind of black plastic thing here, I had a roughness texture with a bit of roughness breakup in there, and you can see it here on the 500 sample version of the render, whereas in a 10 sample version of the render, the de-noise are completely obliterated. All of that detail, there just, everything is perfectly smooth here. There is no back breakup, same thing for some of the details on the shell of our turtle here. So paying attention to the scale detail on the shoulder versus here and on the top of the head. We have a lot of scale detail there there's lots of little nitty gritty stuff. Same thing was the edge of the shell right here. Whereas on the 10 sample version of the render, all of these details on the top of the head and on the shell, it's been completely destroyed by the de-noise or because the de-noise is so aggressive. We can even see on the front of the shell here. We got to kind of not cheer a bit of damage on the shell and here it's barely visible. Let's go ahead and zoom in on the floor here. And the same thing kind of applies. It's actually surprising how well the de-noise are worked, but it's no comparison to the 500 sample version right here. We get so much. Crisp little details. It's the small details like this that make a substantial difference in a quality of a render. And the same thing applies with just the edge of the wood plank here. We got these little notches, the ever so subtle break up of the lines. Whereas here it's just kind of smushed. We've lost a lot of detail here. So again, it's pretty subtle and I'm actually quite impressed with the performance of the Dene Windsor, especially at higher resolution. But if you want the best possible quality, there is really no way around using more samples. In fact, if you have enough samples, you may be able to omit the de-noise or, and. So it's worth keeping in mind that the de-noise or really is mainly intended for use with still images. And you can see here, I have a render with 100 spatial samples with the de-noise or turned on, and you'll notice that right around here or really all across the entire image it's getting really flickery and jittery. And it looks like crap. The reason for this is because the de-noise is not temporal. And what I mean by this is the denoiser, or does not. De-noise the current frame basically. The Dino is of the previous frame. So each frame will be deemed noised in its own way, individually resulting in a super jittery mess like this. Now this can be mitigated somewhat by either having more samples. Adding in, from temporal samples in the mix in the movie render queue. So now you can see right here, the results are much better with temporal samples, but I've increased the contrast here so that we can see more. Clearly, we still get quite a little bit of jitteriness and flickering ness in the shadowy areas, especially areas with lots of details, right around the head here and in the area that have lots of lenses. So just keep in mind that the de noiser does not necessarily work all that well with animated footage. Now, next up in a detailed panel, we also have max bounces. Now the amount of bounces you have here will also affect your render times. So toning down my sample. So let's say 106. And turning my back bounces to one. You'll notice that we start getting a lot less indirect lighting. So what's happening is the light comes in, hits our surface and bounces one time. If I do three bounces, you'll notice we get a bit more indirect lighting, right? Especially our box right here. The box in the bottom left hand corner is a great indicator of what's actually happening here. So by setting this down to one again, You'll notice our box in the foreground is very dark. Cranking this up to 10. Now in the darker areas, things start getting lit up a little bit more. There comes a point of diminishing return when it comes to the amount of bounces. So you don't need to have an insane amount of bounces. In fact, for many renders, I've captured it. Really, you should only be using as many bounces as you need, but we'll get a little bit more into that later when we touch base on the glass materials. Next up we have filter width here, which says the anti-aliasing filter. So lower values will be a sharper and more aliased whereas larger values are softer and blurrier. So it's switching over to another environment here. I just want to show you a few other nifty features that we can find in the past rating settings. So I'm going to go ahead and delete every single light in my scene here. So delete this directional light. And in my eighth year, I backdrop, I'm going to make sure to my skylight, it actually disabled. It's not affecting our world. Right. So we have no license. Our scene. The only thing in our teen will be this emissive HTRI texture. So what you'll see, everything is pitch dark. And when I turn on the path tracer, you'll see, boom, we've got light. And the reason for that is because in the post-process volume, if we search for path trading, We have emissive materials. Okay. So everything that is emissive will cast light. If I turn this off here. Well, there is no more light in nursing. Nothing is happening. So this is the really nifty feature. This is super handy when you just want to throw in. Yeah. Nice looking HTRI you don't need to configure any skylight or anything. Everything just works kind of the way you would expect again, because of the de-noise or you'll see, everything is kind of splotchy. Doesn't look that good. So again, you need more samples if you want some CRISPR results. And now if I want to throw a directional light in here, well I could, and now we have a much brighter. So in this section, I wanted to talk to you a little bit about changes to the way that materials are handled with the path tracer. And we're going to take it. I look at some of these right here. So first off you've got the thin translucent model right here, which is kind of like a clear plastic type of thing, but also cast colored shadows right here. Next up we have proper path traits, glass, which looks phenomenal. And looking at the example here, we now have approximate caustic, refractions, and reflections, which is just so nice to have. Now next up, we have frosted glass, which is the same material as the regular glass material. However, by upping the roughly. Of our glass material. We can now have frosted glass. And lastly, right here, we have random walk subsurface scattering in 4 26. The pass rates are, did not support subsurface scattering. So this is a really, really nice addition to it. In our project. So let's take a look at these materials one by one, just so that you know how they are set up. So starting off with the subsurface scattering, the path tracer now uses a random walk, subsurface scattering method, which all happens under the hood. You don't need to enable any plugins or any settings to get random walk, subsurface, scattering to work. It just does right away. So all I have here is the shading model at the bottom here, set to subsurface. And with these four nodes, I can control the color and how far the light will scatter through my model. Next up, let's take a look at the glass material. You'll see here. It's nothing complicated. We only have a flat base color, roughness, opacity, and the index of refraction of 1.5 with a blend mode set the translucent here and the lighting mode set the surface forwards. That's it. That's all you need to do in order to get really good looking path, trays, glass now, and independent. You want the frosted glass? All you need to do is to increase the roughness of your glass material. If you want to know more about Rachel H. Glass specifically, you can watch my tutorial on it right here. The link of which will be down below. Now, the last one I want to talk about is the thin translucent method right here, and the material set up for this. It's a little bit weird. It's a little bit different than the others. So let's take a look at it right here. Again, the material is pretty subtle. Make sure that we have our blend mode set, the translucent and the shading model set the thin translucent right here. Really? The refraction, no Palestinian roughness settings are all identical to the glass material. The only difference here is you need to add the thin translucent material node right here by pressing the tab button search for it, thin translucent material output, and you'll find it right. And the color right here is what's going to determine the color of your shadow, the color of your actual plastic, or then translucent material. So this is perfect for like plastic wrap or anything. That's very thin like a bubble. I don't recommend that you use this, add the colored glass option. It is not going to look very good. It's going to look more like plastic than glass, even though those material types are relatively similar. They are different. And if you're looking for the absolute, most physically accurate result, you're going to need to differentiate those two. So when working with glass materials, it is very important that you have enough bounces to work with. So let me demonstrate right here by selecting our post-process volume and going into detailed panel, we're going to search for path tracing and let's demonstrate what happened. When I turned down the max bounces to something like one you'll notice none of our glass material. Are really looking like laugh anymore. If I set it to two. Okay. It's starting to look a little bit better. Three a little bit better, and let's say 10 now with 10, they look as they should. So again, when using translucent materials, you need to have enough bounces for them to render correctly. I think I want to talk about in this section is a few changes to the way that the skylight is handled with the path tracer. So. The pass rates are, does not support atmospheric sky or volume metric clouds. So if you have a volume metric cloud sky set up like this, the one that has like really nice sunsets and such you'll notice when we go to the pass rates are here. So sky goes completely black. You're not going to get anything, but there is a workaround. So by selecting our skylight in our scene, if you set it to real-time capture like that, It will capture our sky. So you'll notice it's a little bit blurry. It's a little bit pixelated and low Rez, but if we go back to lit mode, you'll see, it is pretty much the exact same result as our sky. So it is capturing our sky and creating a cube map for us. So going back to the past rates were here, even though it's low resolution, we can fix that. So select your skylight again. And in the detailed panel, we're going to set the cube map resolution right here to let's say 10, 20 feet. And now we have a super high resolution sky, which is almost the same as the sky that we have in lit mode. Not quite the same, but almost, and this should be good enough for most use cases. Now, in the event that you don't want to use a sky system and unreal, but you would rather use an HDI or something. Then the best way to do that would be to use the HTRI backdrops. You can find right here, if you don't see it in the list here, you may need to enable the plugin for the HTRI backdrop. Before I put in my Easter, I backdrop, I'm going to delete my sky system here. Okay. And I'm going to drag and drop the HTRI backdrop into my scene in the HTRI backdrop in a detailed panel. Don't forget to select your skylight right here and disable it because otherwise they're going to get a double lighting. You're going to get the lighting from the image. This of the HTRI itself and also delighting of that's a skylight is casting on your scene. So be careful about that. And now our HTRI backdrop, it's going to be our source of light, and now we can apply whatever HTRI we want right here in the key of map section. So now if I go back to the path tracing mode, you'll see everything kind of looks the way that you would think. So those are two ways to work with either the skylight or an HTRI when using the pass tracer. Alternatively, what you can do is select your sky. Set the source type to SLS specified QMAP and choose acute map of your choice and just like that we can load in an HTRI of our choice very quickly and very easily. You're just not going to have the HTRI showing up in the background like we had with the HTRI backdrops. While you take the time to process that information. I want to take a moment to thank the sponsor that video Skillshare Skillshare is an online learning platform with thousands of classes on just. Any topic you can possibly imagine such as classes relevant to our field of work, 3d modeling, texturing, rendering, filmmaking, photography, you name it. They've probably got it. And let's say you want a break from being in front of your desk all day. Like this guy, you can alternatively take a class on gardening. So those of you who've been following the channel, know that I haven't been on YouTube for very long. At all, I am unbelievably green and I have a, a lot to learn in seeing that market brown leaf now had a class on YouTube success, scripting shooting, editing with MKBHD. He talks about getting your audience hook and growing your channel. I should probably get on that. Skillshare is curated for learning and they are constantly releasing new classes. And what I mean by this is that it is entirely ad free code. You can stay. So because Skillshare is sponsoring that video. I have a special link for you down below the first thousand of you to click on the link in the description below, we'll get a one month free trial at Skillshare so that you can start learning today. And with that being said, let's get back to rendering. So what's all new, amazing features. There are always a series of caveats and. Limitations and things that don't totally work perfectly to become the pasture now supports more feature than it. Doesn't support. I'm going to go ahead and tell you about the feature that it does not support. So we've got hair strands, which are not supported cascade particle systems, spline meshes decals, which is a real bummer because I use decals all the time. And so do you probably, but hopefully that comes in a later version. Next up volumetric fog, exponential high fog, light functioned hair and single layer, water material types. There is no multi GPU support and lastly is semi depth of field support. So it's important to keep in mind that the passenger is only using the regular. Depth of field post-process the depth of field is not a path traced feature. So just keep that in mind and you can see right here, there is some kind of jitteriness going on in the depth of field areas. I am pushing the duct with field, to its absolute limits here. And while it's not perfect, it's. Pretty good. Like the fact that I can get this kind of result so quickly is phenomenal. So yeah, I might sound harsh toward the devs at epic, but hats off to them. The fact that they have pulled this off is so awesome. So I will include it, the link in the description below to the full list of supported and unsupported content. You can find it right. Now a few good things that you should probably know about is that when using really bright materials for interior renders, you should absolutely keep your albido values below one. So more along the lines of 0.8, you should not be using a value of one anyway, because there is virtually nothing in the world that has no Beto of one. Even the purest whitest snow on a top of the Andes will have an albedo of like zero point. So to keep your render times lower and get a better result, you should keep your base color or your albido out a value of 0.8 or lower. It's a double whammy. You're really, it's a win-win. And that brings us to the next section of this video. How do you have to move your render queue with the path tracer in order to export? Amazing. So the path tracer now works flawlessly was the movie render queue, as you saw in the intro of the video. So I'm going to show you how to set it up. Now, if you're not familiar with how to use the movie render queue, you can find a tutorial on it right here, and you can find the link down below. So let's open our movie render queue settings by clicking right here and let's click on our settings. It is really important to know that when comes the time to render within movie render. You're not going to control the samples through the post-process volume. That is the key takeaway here. So by going to the settings tab here and adding the antialiasing tab, the samples of your path tracer are controlled through the spacial sample count right here. If I wanted to have, let's say 500 samples, you need to enter 500. Right here. You should also override the anti-aliasing and set it to none for better results. But you're also going to want to play around with the temporal sample count because temporal samples will give you a much better motion blur than spatial samples. Now keep in mind that the temporal samples and the spatial samples kind of work together and they multiply one another. So let's say for example, I wanted to have five temporal sample counts. You no longer need to have a spatial simple count of five. You only need 100 because it's going to do 100 times five for a total of 500 samples. If you wanted to have 10 temporal samples, then you only need to have 50 spatial samples. So what I recommend you to do, if you start by figuring out how many samples you're really going to need for your render and then do the math and then figure out how many spatial and temporal sample counts. That is how it works. And that's really the main takeaway here. And now, lastly, before rendering, you're going to delete the deferred rendering tab here, and we're going to add. Path tracer. And you can find down here, you'll see here. The passionates are the exact same settings as a deferred rendering tab, and that's really all you need to do. So my preferred rendering settings are as follows. The temporal and spacial sample counts completely depend on what it is, I'm rendering, but in general, 16 spatial samples and 16 temporal samples are a really good starting point and last. Turn off that Dean wiser. Yeah. You heard me noise is detail. Every moving to noise means removing the detail and your results are going to end up like a splotchy myth. Like we've seen it in the examples throughout this video. So in the example you saw in the intro, absolutely. No de noising was used and the result turned out pretty. Okay. In fact, I prefer to de-noise my rendered in posts that like individual results or something, because I have way, way more controlled. Once you determine how many samples you need. And the movie render queue is set up correctly. Hit that record button. It's a bit of framed out. This video has helped you out. Don't forget to hit the subscribe button. It really makes a big difference. Thanks so much for watching and we'll see you next time.
Info
Channel: William Faucher
Views: 480,098
Rating: undefined out of 5
Keywords: UE4, Unreal Engine 4, Unreal Engine, Cinematics, UE5, Realtime, realtime rendering, rendering, CGI, 3D, 3D Artist, path tracer, pathtracer, ue4 4.27, 4.27, offline rendering, tutorial
Id: X5zVhc5ahl0
Channel Id: undefined
Length: 26min 8sec (1568 seconds)
Published: Thu Aug 26 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.