Exploring the depths of the new Sky & Atmosphere system | Unreal Engine

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

It's very impressive what they have achieved opening up so many possibilities for even smaller developers. The future is very bright. :)

πŸ‘οΈŽ︎ 46 πŸ‘€οΈŽ︎ u/Spenceronn πŸ“…οΈŽ︎ May 09 2020 πŸ—«︎ replies

This looks fantastic! I’ve wanted something like this for ages. Unreal 4’s sky system was always really basic.

πŸ‘οΈŽ︎ 9 πŸ‘€οΈŽ︎ u/Headytexel πŸ“…οΈŽ︎ May 09 2020 πŸ—«︎ replies

Geez, it’s not gonna be long until the one thing that Star Citizen constantly touts is gonna be free and available to literally anyone with a copy of Unreal Engine and a decent PC, huh?

πŸ‘οΈŽ︎ 38 πŸ‘€οΈŽ︎ u/Thomastheshankengine πŸ“…οΈŽ︎ May 09 2020 πŸ—«︎ replies
Captions
>>Sjoerd: Hi, and welcome to this presentation on our new sky and atmosphere rendering that was first added to Unreal Engine 4.24. My name is Sjoerd De Jong, also known as @Hourences, and in the next half an hour, we're going to take a look at the following. We're going to start off with the basics. I'm going to show you how easy it is to get going with the new sky and atmosphere rendering. It simply works. You drag it in, and within seconds, you're up and running. Then we're going to move over by taking a look at the various settings that are available, and then we're going to step it up. We're going to go into space and look at how the new sky and atmosphere rendering adjusts itself to a space view. We're going to take a look at the material integration of the new feature, a number of random tips and tricks, a couple of CVars to talk about. And then by the end we're going to wrap up by taking a brief preview at the new volumetric clouds that are going to be added in 4.26. And there will also be at the very end, a note of this presentation, a quick recap of all the recent changes and upcoming features. Before we do get started, I would like to give a bit of credit and highlight a few contributors. So first of all, a big thank you to the entire Unreal Engine engineering team. In particular, Sebastien Hillaire, who is the principal architect and engineer behind all of the sky and atmosphere and volumetric cloud rendering that you're going to be seeing. Also, I'm using a lot of assets from Quixel Megascans and from our Marketplace. I'm using the spherical shader from Nightshift Studios, Tropical Jungle Pack from PolyAsset3D, the Meadow from NatureManufacture, the Fictional Aircraft Pack from ModelWorks. And you can see all that content comeback in this environment, which is what we're going to be working with. So this is the result we're looking for. It's a bit of an alien-ish planet. You can see it has a double moon there. And this is what we're going to use as a demo scene to show the sky and atmosphere rendering. Let's get started. So starting with basics, it is very, very simple to get this up and running. In fact, we only need to do two things. We need to work with the Directional Light and with the Sky and Atmosphere Actor. We'll switch over to the environment. Here is the environment you saw before, but without any light, any sky present. It's a very big world. We've got a little valley here, a little space we're going to leave the camera at most of the time. This is our scene. Now, first things first, a Directional Light. Here's a Directional Light. Let me drag it in a little bit more towards the center. Switching the view mode to lit mode. And out of artistic purposes, I'm going to set the intensity to 12. But the really important thing here is that if you look in the advanced options, it says here, Atmosphere Sunlight, Yes. So you have to enable that. That registers this Directional Light as being a Directional Light, a sunlight, there has to be detected by atmosphere rendering. Once you've done that, you're pretty much there. You can go to Visual Effects, Sky and Atmosphere, drag that in, and that's really pretty much it. By having done that, we're immediately there as I zoom out a little bit, you see get the shading. All the atmosphere is being rendered. The sun is being rendered. And if you were to rotate the sun, the Directional Light-- in fact, you can do that with the shortcut Control-L. If you hold Control-L, and while holding it, you simply move the mouse, you can do this. And you can see it all nicely updates. Now we have evening, sunset, getting nights. Then you can have sunrise again. So all of that pretty much simply just works. That's the basics. It's two steps, and you're up and running. Now, that being said, there are a number of additional settings we can play around with. As you see in the Properties that we have over here, there's a few things that are important. And you're welcome to play around with all of them, but I'm going to change the ground radius to 1,000. The important thing to note here on the sky and atmosphere feature is that it's physically based, so it tries to approximate as good as it can a real atmosphere of a planet. So it's important that it understands how large the planet is. I'm going to put it to 1,000. I have a pretty small planet. This is going to come into play when we go into space. Right now, more immediately, though, we've got these three main settings, Rayleigh, Mie, and Absorption. All of these have to do with a scattering of light and therefore color in the atmosphere. So this is affecting how the sky basically appears. So for example, Rayleigh scattering is primarily focused on the scattering from atmospheric gases. Mie is primarily from dust, smoke, water droplets, that kind of scattering. And Absorption is ozone. So if you were to lower Rayleigh Scattering to a much lower amount, you can see what happens. If it's zero, there is no scattering at all. Essentially, you are now looking into space. So if you have a very thin atmosphere, you would have something like this. And so you can play around with it. If you increase it, it gets ever-redder. And you can use this to create alien environments, maybe simulate a sandstorm or anything in those kind of directions. Mie Scattering is similar. See, what happens there is basically you get a lot more reflection and scattering of light between the particles that are floating around in the air, so you get a very dusty environment. And the other way around, if you bring it to zero, it gets reduced. And likewise, so, with Absorption Scale. So those are the three main settings you can use. You can also apply an override for the Rayleigh scattering color, so a different kind of alien environment, if you wish. But that's the bulk of it. Now, that being said, where this gets really, really cool, I think-- the first time I did this, when I first got my hands on this, it was eye opening. You can go into space. In fact, the sky and atmosphere rendering is dependent on altitude. So if you were to go up with the camera-- and you might need some fairly high camera settings here. So I'm using Camera Speed six. I've got Camera Speed Scale at 32. You might even make that 64, or something like that. You need fairly large numbers. I'm going to point the camera up, and I'm going to fly up. You can see, as I start flying up, the atmosphere actually starts to thin automatically. It's thinning. It is darkening. This is kind of a plane altitude. Keep going up. You eventually automatically go into space. This is amazing to see. You can see, in fact, if I start going up all the way, we've left the planet. We're now in space. The atmosphere is a sphere, and if we were to rotate the sun while in space, you get some really nice shading and effects that just automatically appear on the surface of the planet and on the atmosphere that surrounds the planet. In fact, I'm going to position the twilight zone over our playable area. Now we basically have this. You can see it's pitch black here. It's night over here. This is morning or sunset, whatever you want to call it. This is twilight zone. And if you start going back into the surface here, into the area, you'll get this really nice blending of light. This is amazing to play around with. A couple of other cool things about this. As you fly away-- and again, you might need some very large numbers. I'm going to bump it up a bit more. I'm going to move the sun a little bit again. There is an option here called Transform Mode. By default, that is simply set at World Origin. But if you set it at Planet Top at Component Transform, you can move the whole atmosphere. That's a cool thing. There's another very cool thing, is the fact that by having a setup like this, where you essentially actually have space surrounding an actual planet with an actual atmosphere, it means that if you were to want to simulate a moon, you can do so by placing an actual, full-sized moon into the environment. Over here, I've made a simple Blueprint that holds two giant meshes. So you can see there's nothing in here. It simply creates a material instance. If you look in the viewport-- and it might be a little bit difficult to see in here, but we've got two gigantic meshes, a moon of a moon, and the main moon itself. But that's basically it. If you place that into your world, placing it and put it to 0, 0, 0, just for artistic purposes-- and what we've got now is we've got an actual moon in here. This is an actual 3D mesh. You can fly to it. In fact, you might need even more speeds. And we're talking about millions and millions of units here. And it's, again, amazing to see, I think, that the engine is handling this so well, even though you're at massive scales. So we've flown to the actual moon. If you look at the surface of the planet, you can see that moon from the surface of the planet. It's a bit low in altitude, so I'm going to raise the altitude a little bit just for the sake of getting it to appear. And you can see we are dealing with immensely large numbers here. So I have 20 billion, or whatever I just entered. The moon shows up and blends with the atmosphere automatically. If it gets evening, you actually get a half moon. You can get a full moon, depending on where the sun is on the other side of the planet in the middle of the night. All of this is just really, really awesome to see. So that's one way you can approach moons with this system. Now, a few things more before we move on from there. There's a couple of CVars here. In fact, there is a wide number of CVars available, around 20, 30 or so at the current count. Later on in this presentation, I'm going to show you which ones I'm using in this presentation. But just to highlight the most important ones before we get to that point, FastSkyLUT and FastApplyOnOpaque. I have turned both of them off. By default, they're enabled, and they're enabled for the sake of performance. If you disable it, you lose a little bit of performance. It does seem perfectly reasonable. But you get higher quality. And in particular, when you need a transition from ground to space, you might notice with the default settings that you get a slight bump. There's a slight hitch at some point where it switches from ground view to space view. If you disable these two, you're going to get it completely smooth, like I just had in my presentation. There's a few other things there, too. SampleCountMax in particular. This is going to be very difficult to show on the video due to the compression, but you can try this at home. SampleCountMax is essentially the quality of the atmosphere rendering. If you bring this down to 8 or 16 and go into space, you're going to see a dotted structure on the atmosphere. It's noisy. If you make it 64, it's going to be smoother. Moving on to material integration. Here's another really cool thing, I think. Because the feature, as it is, it's really, really cool. But you might get to a point where you want to customize further. Let's say you want to do clouds. Let's say that for some artistic purpose, you want to do something special with this sky that goes beyond the gradient that it generates by itself. Let's say you want to go further. You can do that, because the Material Editor is able to intercept the rendering and work with the information that the sky renders. In fact, I have a very, very basic sky sphere here. I'm going to place it as an example, and make a very basic example out of it. Position the camera back at some central place. Here's the sky sphere. Again, a very basic mesh. And I have a basic material, which is my basic sky material. Drag that on top, and what we're getting now is this. Now, the material is not finished, so it's currently black. Go into the Material Editor and take a look at what we have. There is a number of nodes that are exposed in the Material Editor. So the Sky and Atmosphere Aerial Perspective, Distant Light Scatter, Luminance, a couple of these other ones, right? Several of these are more optional. This Atmosphere Aerial Perspective is the sun's wide glow and tint. So essentially, the wider glow of light that comes from the sun in the sky. Distant Light Scattered Luminance is the atmosphere ambient light or ambient tint, which is really useful for a few things. We'll get back to it in a bit. Light Direction is the actual angle of the Directional Light. Also really useful. I'll show you a few tricks with that in a bit. And then Light Disk Luminance is the sun itself, so just the circle that makes up the sun. Light Illuminance is the atmosphere intensity color of the sunlight hitting the atmosphere. So the way the light actually hits the atmosphere itself. And then Sky Atmosphere View Luminance is the gradient as you see it. So essentially, this one and this one is what we're seeing by default. In other words, if I were to connect just this one to emissive, and it has to be set-- by the way, the material has been set Shading Model Unlit, which is a requirement. And there is a property in here that says, Is Sky? And we've said yes, it is a sky. Right. So just applying this and taking a look at the sky, we have-- we're now getting the same gradient rendering on our sphere. If you were to make the sphere larger than the small one, we would get this. You can see it cuts up from the world. If you go through the sphere, we see the rest of the world, right? So it's the same way we've made skies in Unreal for many years, but now using this system. Now, if you add these together, if you add to the Light Disk Luminance and View Luminance together, you're getting what you had before. So this is the most simple setup that mimics exactly what you had before. You can see, the sun is there and you have the gradients. It's real-time. Everything's exactly the same, except it now renders a sphere. But you can go further with that, which is interesting. So for example, you could do clouds with this system. I have a very basic set-up here, but it shows a potential. I have a simple cloud texture. It's panning a little bit. It's a little bit scaled. It uses the Distant Light Scattered Luminance to apply the ambient color of the atmosphere to the clouds, so that the clouds aren't full bright, but the clouds are actually adjusting their color to the current ambient tint, making a little bit brighter. And I'm going to add that together with what I already had. And that becomes emissive color. Having done that, we get some very basic clouds. And again, the sky is a bit small scale, so it looks a bit weird. But as you can see, in the sunset, the cloud colors nicely blend in with that. So you get basic clouds. If you make a more complex set-up out of this, this is one way you could do clouds. That being said, there is a different way. So I'm going to delete that again. Close material. I'll show you an alternative. This is another approach I've trialed. I've made a basic Blueprint here called Cloud Layer, but the only reason it's a Blueprint is just to make it easy for me to place during this video. Within that Blueprint, there is nothing there. It's completely empty. There is just a Static Mesh there, and the Static Mesh is a very, very, very large plane. In fact, the plane is as big as the entire surface area of the entire planet. That has a material applied, which is this material. And this is now my cloud rendering. And I'm using very much sort of the same system, so I'm blending in all kinds of different cloud textures. And we're blending that with a couple of different other things. When you go into space, it gets brighter on the edges with Fresnel and that kind of thing. But at the end of the day, I'm using the sky atmosphere information in the material. It's the same thing, except for what I've done differently, is that in the properties, it is set to translucent, and I actually haven't used a sky. And by having done that, this allows me-- as an alternative way forward, this allows me to have a translucent layer that literally goes around the entire planet. You can see, there is a cloud layer here, a very high-altitude, thin cloud. That is a large, planet-surrounding translucent layer. In fact, if you go into space you see those clouds surrounding the planet, and they blend with the light as well. So that is an alternative way of doing this. And then you have the moons rendering behind the clouds as well by doing it like that. Now, this entire material integration that you have here has other purposes as well. There's all kinds of things you can do with it. One of the things, for example, I have over here is a simple example, too. But I have some smoke drifting through the whole world. That's the Niagara particle system. That's not that important. What is important is the material that is attached to it, because that material is also reading into some of this information. So the important one is Light Direction. Light Direction tells you the angle the sunlight of the Directional Light in the material. If you know the angle, you know when it is night. In other words, your materials can understand when it becomes night. You can have headlights of vehicles automatically turn on the moment you rotate the sun away with Control-L. You can have lights in vehicles and buildings and everywhere else automatically turn on. You can have particles like the cloud particle automatically increase or decrease in brightness as soon as it gets night or certain conditions are met. So some really cool things you can do with it. You can use it to blend things better into the atmosphere by reading that information. Next up, we're going to take a look at a couple of random tips and tricks and CVars as well as the stars, an approach to how to do stars. First of all, Heightfog. So if you had the normal Exponential Heightfog-- and just for information, the original Atmospheric Fog is not compatible together with the new sky and atmosphere. But the Exponential Heightfog is. So if you were to drag that in-- so I'm going to combine the two, and this gives you some additional control over the fog because you need more density or up close or in valleys or anything like that. So I've dragged it into the world. Now, by default-- in fact, I can show you that by putting the height fall-off a bit more extreme. So now we have very, very dense fog. But in the valley over here, by default, that will not respect the sky and atmosphere and the updating of the sun. So a few things that you would have to do. First of all, in the project settings, you would have to enable Support Sky and Atmosphere Affecting Heightfog. So I have that enabled. Simply look for height, or one of the other keywords, and enable that. And once you've done that, also important is the coloring is actually additive. So fog in scattering color and directional in scattering color, they're additive. So you're supposed to make them black. And if you've done that, then it will now respect, automatically, the same blending of colors and everything else and update along with the sky. We'll fly into the fog over here so you can see. Again, some really nice pictures you can make with that. Really nice atmospheres you can make with all this stuff. And these kind of-- nice, the silhouettes of the trees here. Some-- it's just-- it's just awesome to play around with. I'm going to set the density to a much, much lower value for a second. Here we are. You can also drive this through Blueprint. You can do this the usual way by simply scripting anything you wish into it, right? So you do something on tick, for example, in the Level Blueprint or in an actor, or you could say on tick, update the sky and atmosphere Rayleigh scattering, when it gets evening, or when a storm comes in, or anything like that. You can do that on the fly. In my case, this one's a little bit more challenging, because I wanted to make sure that everything works entirely and only in the viewport. That was a bit more of a challenge. To facilitate that further, we've made a change that's going to come in 4.26 that will allow you to use a construction script when you're using Control-L. Right now, in 4.25, that is not yet supported. So what I've done now is I'm going to delete the Directional Light I placed a while ago, and I'm going to place a Blueprint Directional Light instead. Here we are. And so now everything looks the same, works again the same way. But if you look at what I've done in that Blueprint, I have a bit of functionality in here. So you're welcome to script any of this similar to what I've done. Because of this, I now have support for an eclipse. You can see the moons are also rotating around. And if ever I can get the sun to show up behind the moon, which is a little bit difficult at the moment. I'm going to reset the position of the moon, which I've previously increased too much. Let me do it like this. I actually have support for an eclipse. It darkens, and the sun comes out again. There's a bit of flickering from the Control-L previewing, but it works. And all of that is just done through Blueprint. Now, as mentioned, this is running on construction script. In 4.25, the construction script does not update when you lose Control-L. In 4.26, it will, and therefore it will enable this use here. If, meanwhile, you want to do something like this in 4.25, my work around before has been to build a Blueprint widget, and in the Blueprint widget, you can do things per tick, even in the editor. So I have the same set up over here, and that has the same result. Another important CVar here is MultiScatteringLUT HighQuality. You can enable that it. Will give you a higher-quality multiscattering. And it will be noticeable both in space and on the surface of the planet. You will get a nicer scattering of light. There's also a way of doing stars. This is a little bit of an experimental approach I've taken here, but I'd just like to share what I've done. I have a post process material in here. So there's a post process volume that has a blendable, post process blendables, which is this one over here. And if I enable that, this is currently disabled for the sake of the video, and it becomes night, you get stars blending in. Stars rotate around with the sun to simulate the orbit of the planet. But it actually nicely blends with the atmosphere, OK? Including if you go into space, I've got stars here, too. The way I've done this-- and again, it is a bit of a weird work-around, I would say, but it is a post process blendable here that blends a cube map of stars into the furthest-away pixels. So you've seen that I only take the furthest-away pixels. I do a couple of additional checks. I check it the camera is in space or not. Then it behaves differently. And I check how bright the sky itself is if you're on the surface of the planet. And I fade in the stars only in those spots where the sky is dark enough. So not where the sun is located, and more like on the other side of the horizon during sunset. And that becomes my set-up here to blend in stars in a way that I can go from the surface of the planet into space and back and have that work seamlessly. So that's one approach you can take there as well. There is a thing that's been an Unreal for a long time. It's the ability to capture the updated skylight. So that has been in the Engine for a long time, but it's always been a bit slow. It's been heavy on performance. So up until 4.25-- until 4.26, rather. 4.25 is going to be the last version that has it like that. A few words here on the updating of a skylight. Now, until 4.26, so before Unreal Engine 4.26, so as it is currently, at the time of recording of this video, in 4.25, the way, and the only way, you could capture and update the skylight would be to use the Blueprint, the appropriate Blueprint node, that would do exactly that. Here's an example of that. This is currently stopping it, because I don't need it in this version. But I had a delay in there. Every half a second, it would do Recapture Sky on the skylight. That was the only way. That was pretty heavy on performance. You would notice a noticeable hitch in performance every time that would trigger. It would be significant. So in 4.26, and moving forward, we've added a new option on the skylight itself that is called real-time capture. If you enable real-time capture, it will do exactly as the name implies. It's completely smooth and completely in real-time. And it costs very, very little performance. I'm using a 32 cube map resolution here to further reduce the performance impact. On a Playstation 4, this is currently taking 1.4 millisecond for a 128 cube map, so the performance cost is perfectly reasonable. And that's a really nice feature that's coming in the future. It's simply a tick box, and it works. Now, earlier I mentioned that I'm using a whole number of specific settings here. So for reference, these are the settings that I am using, the different CVars. This is a high-quality setup. It's not necessarily what you'd use for a game. But so this is the high-end approach to it, and you're welcome to experiment with it. A couple of these are specific to 4.26, like everything, essentially, volumetric cloud is for the new volumetric cloud system. That is currently not yet in 4.25. But you're welcome to experiment with these settings. And I'm going to wrap up by looking at the new volumetric clouds. So while you can build a cloud with translucent layer that goes around the entire planet, or perhaps blending into the sky material, displacing the sky dome-- that works, but in 4.26, you're going to get this amazing new feature. Again, this is one of these kind of things where if you're just playing around with it, it's just utterly amazing to play around with this. These are volumetric clouds. If I move them, when the sun moves, I've made it so that also the clouds are moving. You get this. And it's amazing to play with. In fact, you get automatic god rays that go through the clouds. You get darkening of the environment-- not just of the environment locally. It cast an actual shadow on the entire world with god rays as the clouds are moving by. So the most amazing stuff to play with. You can go into the clouds, if you wish, et cetera. Fully 3D. This is being set up in the same way that you do the current volumetric rendering. So there is support in the Unreal Engine for volumetrics. This uses the same system. It uses an actor called Volumetric Cloud Actor that gets placed in a world. In itself, it doesn't do too much. There's not too many settings available. In it is basically the height of the clouds, the altitude or the clouds. But most of the work will come down from the material. And so it uses a volumetric cloud material. And this is the one I've made. This is built in part on top of Ryan Brucks' initial one, where-- and this is the core of that material. It uses a volumetric texture to define the noise of the overall 3D shape of a cloud, and then it blends various other textures on top, various ways of panning it, subtracting parts of the bottom, softening, and a couple of different setups here. And then this is what drives the clouds. To recap, in 4.25, we've added the ability to move the whole atmosphere when, for example, in space, per pixel atmosphere transmittance, so you can have atmosphere shadow on other measures, for example moons. Sun luminance is now scalable and colorable. You can scale that via the properties if you need to do so for artistic purposes. That's going to be 4.26, though. Also in 4.26 is the whole volumetric cloud rendering. Sky and atmosphere volumetric shadows, as you've just seen in-- a couple of minutes ago. Construction script support for Directional Light using Control-L, and the new real-time skylight capture and convolution in a performance-friendly way. That is what's coming up next. So that brings us to the end of this walkthrough of our new sky and atmosphere rendering capabilities and features. I hope you enjoyed it, and thank you.
Info
Channel: Unreal Engine
Views: 372,542
Rating: undefined out of 5
Keywords: Unreal Engine, Epic Games, UE4, Unreal, Game Engine, Game Dev, Game Development
Id: SeNM9zBPLCA
Channel Id: undefined
Length: 24min 59sec (1499 seconds)
Published: Thu May 07 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.