‫Hello and welcome.
‫In this lecture, we're going to be setting up some lighting in our scene.
‫We're going to add some sunlight and a sky.
‫And we're going to also look at the five different types of lighting available to us in Unreal.
‫Let's dive in and learn all about it.
‫So if we were to switch from our currently unlit mode in to the lit mode, you'll see that everything
‫is 100% dark.
‫And the reason for this is that we've got no lights in our scene, nothing by which to illuminate everything
‫around us.
‫So let's go ahead and create a new folder in the outline, which we're going to call Global.
‫And this is going to be for stuff like global lighting.
‫And then we're going to go to the quickly add to project and open up our place actor panel.
‫And in here we're going to go to the lights tab and have a look at the five different types of light
‫that we can put into our scene.
‫Perhaps the simplest to think of is the point light.
‫If I drag this into our scene, you can see immediately the kind of effect that it has.
‫Light emanates from a single point outwards, and that's pretty much it.
‫We can change how powerful that light is.
‫We can change how it trails off, we can change the color of the light.
‫But the fundamental property of that light is that it is a point source light.
‫So let's remove that light now and let's try a spotlight instead.
‫So a spotlight, as the name suggests, has some sort of directionality to it, but it still emanates
‫from a point.
‫Now, I think these are very much like your standard kind of halogen lights, your spotlights in your
‫house.
‫And obviously they can be very useful for trying to illuminate a specific area or a specific object.
‫All these lights can be rotated.
‫So obviously with a point light rotation didn't make much sense, but with a spotlight rotating, it
‫allows us to illuminate different areas.
‫So that's the spotlight.
‫Notable mention just to the rectangle area light, rather than being a point source here, you can see
‫that the light's actually emanating from the entirety of this rectangle.
‫So you can see if I point it down, it's just a wider area for it to come from.
‫And obviously this would work well with office lighting or anything where you want to illuminate from
‫a larger area rather than from a particular point.
‫And then two interesting ones here that are more natural are the directional light and the skylight.
‫You can see the icon for directional light looks like the sun.
‫And that's because the most common use of it is in fact as a sun light.
‫So if I stick this in the scene, you'll notice that it doesn't actually matter where I place this actor.
‫I could place it anywhere and the light doesn't change.
‫The only thing that's important here is the rotation of the light.
‫If I change the rotation, you can see it changes the angle of these rays of the sun.
‫And that's because the sun is so infinitely far away from us that essentially the light that reaches
‫our scene is all parallel, is all going in a single direction.
‫And that's why it's called a directional light.
‫So the position doesn't matter because it's so infinitely far away that it shouldn't make a difference.
‫And then the other thing, so if I delete this one out and we put our skylight into the scene, this
‫is another one where the direction doesn't matter, but this time it's because the light is coming from
‫all directions.
‫And at the moment it's actually not being not showing us anything very much at all.
‫And if we go and have a look at the description of what a skylight does, you'll see that the light
‫actually captures the distant light in our level and applies it to the scene as light.
‫So typically the way we deal with this is by bringing in a massive sphere that goes around our entire
‫level and simulates the really far off sky and distant horizon.
‫Now, a place that we can go and find this is if we open up our content drawer, go to the settings
‫button in it and select show engine content, and then you see an engine folder pops up.
‫Let's click on that.
‫And inside that folder we're going to search for Sky.
‫Now what we want is this BP sky sphere.
‫We can go and drag this in to our level and you can see if you pop out of the level that we've now got
‫a sphere here that is absolutely massive and basically simulates the far off distant sky in the clouds
‫and the sun in the sky.
‫So that is what our skylight is trying to capture the light for that.
‫So we need to click on the skylight and we need to go scroll down to a property called Recapture Scene
‫and we click on Recap.
‫You.
‫And you can see that the light now gets updated to represent that kind of soft twilight that is illuminating
‫everything a little bit evenly.
‫And that's what we wanted.
‫And you can see inside, it's still quite dark.
‫We've only got a little bit of light spilling in from the outside, but it's given us a nice soft ambient
‫light.
‫So typically what happens is that we will put the skylight and the sky sphere together and also have
‫a directional light on top of this as well.
‫And we can set the direction of that light as we see fit by just kind of rotating it around like this.
‫And if we then go back and select our Sky Sphere blueprint and look at the details pane for it, you
‫can see that there is a link that it could want to a directional light actor so we can select this asset
‫by selecting the actor in our scene to pick that directional light.
‫And you can see that instantly.
‫What it has done is it's changed to a much brighter daytime and the sun is high up in the sky.
‫And that's because by linking those two in together, what we've said is that the sky sphere should
‫match the angle of this directional light.
‫So if I put the angle of the light really low, the sun hasn't quite updated because we'd need to go
‫in to our BP sky actor and hit refresh material, which then redraws it.
‫And you can see the sun.
‫Sun is now low in the sky and the color of the sky has been automatically updated.
‫So these two things being linked together is a really good thing.
‫It makes them physically much more accurate.
‫So I'm just going to put it back to the sun being reasonably high up in the sky, and then we can go
‫to our BP sky sphere and just refresh its material one more time.
‫Now, these actors haven't gone in the global folder yet, so let's go drag them in there.
‫And these are all the things that apply at a global level, so it just allows us to tuck them away nice
‫and neatly.
‫So I'd like to challenge you to add some sunlight to your own scene.
‫So you're going to add a sky sphere, add a direction light and a skylight and link them together,
‫as I've just done so that when you move the direction light, it can update the material for the sky
‫sphere and the sky light then can recapture the light from that skysphere and change the rotation of
‫the sun.
‫Maybe you want a different mood to your game.
‫Mine's more high in the sky, but you might want a lower sun to represent a later time in the day.
‫Pause the video and have a go.
‫Okay.
‫Welcome back.
‫So.
‫Well, this is how I've got it at the moment.
‫The only thing I want to check is the skylight looks quite orange, so I'm guessing we haven't recaptured
‫the skylight.
‫So I'm going to the skylight and then scrolling on down to where it says recapture.
‫I hit recapture.
‫Now you can see the skylight has gone far more blue in the shadows, and that's because the reflected
‫atmospheric light in our skysphere is more blue because of the sun being higher and the rays not getting
‫scattered and all that kind of physical goodness.
‫Now you may notice that some of the shadows here are looking rather strange.
‫Don't worry about this just yet.
‫We are going to fix this in a later lecture.
‫So that's it for this lecture.
‫We've looked over the different types of light that we can have in our scene and the most complex set
‫up being how we do sunlight.
‫I'll see you in the next lecture.