﻿1
00:00:04,450 --> 00:00:05,650
‫Hello and welcome.

2
00:00:05,650 --> 00:00:09,660
‫In this lecture, we're going to be setting up some lighting in our scene.

3
00:00:09,670 --> 00:00:13,270
‫We're going to add some sunlight and a sky.

4
00:00:13,270 --> 00:00:19,750
‫And we're going to also look at the five different types of lighting available to us in Unreal.

5
00:00:19,750 --> 00:00:22,570
‫Let's dive in and learn all about it.

6
00:00:22,570 --> 00:00:29,260
‫So if we were to switch from our currently unlit mode in to the lit mode, you'll see that everything

7
00:00:29,260 --> 00:00:31,300
‫is 100% dark.

8
00:00:31,720 --> 00:00:38,200
‫And the reason for this is that we've got no lights in our scene, nothing by which to illuminate everything

9
00:00:38,200 --> 00:00:39,250
‫around us.

10
00:00:39,400 --> 00:00:45,280
‫So let's go ahead and create a new folder in the outline, which we're going to call Global.

11
00:00:45,280 --> 00:00:48,370
‫And this is going to be for stuff like global lighting.

12
00:00:48,550 --> 00:00:54,760
‫And then we're going to go to the quickly add to project and open up our place actor panel.

13
00:00:55,060 --> 00:01:03,040
‫And in here we're going to go to the lights tab and have a look at the five different types of light

14
00:01:03,040 --> 00:01:05,200
‫that we can put into our scene.

15
00:01:05,530 --> 00:01:09,040
‫Perhaps the simplest to think of is the point light.

16
00:01:09,040 --> 00:01:13,540
‫If I drag this into our scene, you can see immediately the kind of effect that it has.

17
00:01:13,630 --> 00:01:19,270
‫Light emanates from a single point outwards, and that's pretty much it.

18
00:01:19,270 --> 00:01:23,170
‫We can change how powerful that light is.

19
00:01:23,170 --> 00:01:28,210
‫We can change how it trails off, we can change the color of the light.

20
00:01:28,210 --> 00:01:33,010
‫But the fundamental property of that light is that it is a point source light.

21
00:01:33,250 --> 00:01:39,160
‫So let's remove that light now and let's try a spotlight instead.

22
00:01:39,160 --> 00:01:43,900
‫So a spotlight, as the name suggests, has some sort of directionality to it, but it still emanates

23
00:01:43,900 --> 00:01:44,890
‫from a point.

24
00:01:44,920 --> 00:01:51,190
‫Now, I think these are very much like your standard kind of halogen lights, your spotlights in your

25
00:01:51,190 --> 00:01:51,790
‫house.

26
00:01:52,180 --> 00:01:58,120
‫And obviously they can be very useful for trying to illuminate a specific area or a specific object.

27
00:01:58,120 --> 00:02:00,820
‫All these lights can be rotated.

28
00:02:00,820 --> 00:02:05,920
‫So obviously with a point light rotation didn't make much sense, but with a spotlight rotating, it

29
00:02:05,920 --> 00:02:08,650
‫allows us to illuminate different areas.

30
00:02:08,650 --> 00:02:10,840
‫So that's the spotlight.

31
00:02:11,200 --> 00:02:18,040
‫Notable mention just to the rectangle area light, rather than being a point source here, you can see

32
00:02:18,040 --> 00:02:22,720
‫that the light's actually emanating from the entirety of this rectangle.

33
00:02:22,720 --> 00:02:27,190
‫So you can see if I point it down, it's just a wider area for it to come from.

34
00:02:27,190 --> 00:02:32,380
‫And obviously this would work well with office lighting or anything where you want to illuminate from

35
00:02:32,380 --> 00:02:35,710
‫a larger area rather than from a particular point.

36
00:02:36,250 --> 00:02:42,340
‫And then two interesting ones here that are more natural are the directional light and the skylight.

37
00:02:42,340 --> 00:02:45,610
‫You can see the icon for directional light looks like the sun.

38
00:02:45,910 --> 00:02:50,050
‫And that's because the most common use of it is in fact as a sun light.

39
00:02:50,050 --> 00:02:56,590
‫So if I stick this in the scene, you'll notice that it doesn't actually matter where I place this actor.

40
00:02:56,590 --> 00:02:59,920
‫I could place it anywhere and the light doesn't change.

41
00:02:59,920 --> 00:03:04,240
‫The only thing that's important here is the rotation of the light.

42
00:03:04,240 --> 00:03:09,970
‫If I change the rotation, you can see it changes the angle of these rays of the sun.

43
00:03:09,970 --> 00:03:17,650
‫And that's because the sun is so infinitely far away from us that essentially the light that reaches

44
00:03:17,650 --> 00:03:22,030
‫our scene is all parallel, is all going in a single direction.

45
00:03:22,030 --> 00:03:24,220
‫And that's why it's called a directional light.

46
00:03:24,220 --> 00:03:29,320
‫So the position doesn't matter because it's so infinitely far away that it shouldn't make a difference.

47
00:03:29,710 --> 00:03:34,930
‫And then the other thing, so if I delete this one out and we put our skylight into the scene, this

48
00:03:34,930 --> 00:03:40,120
‫is another one where the direction doesn't matter, but this time it's because the light is coming from

49
00:03:40,120 --> 00:03:41,110
‫all directions.

50
00:03:41,110 --> 00:03:46,720
‫And at the moment it's actually not being not showing us anything very much at all.

51
00:03:46,720 --> 00:03:50,380
‫And if we go and have a look at the description of what a skylight does, you'll see that the light

52
00:03:50,380 --> 00:03:55,240
‫actually captures the distant light in our level and applies it to the scene as light.

53
00:03:55,240 --> 00:04:01,150
‫So typically the way we deal with this is by bringing in a massive sphere that goes around our entire

54
00:04:01,150 --> 00:04:06,250
‫level and simulates the really far off sky and distant horizon.

55
00:04:06,370 --> 00:04:13,210
‫Now, a place that we can go and find this is if we open up our content drawer, go to the settings

56
00:04:13,210 --> 00:04:20,230
‫button in it and select show engine content, and then you see an engine folder pops up.

57
00:04:20,230 --> 00:04:21,310
‫Let's click on that.

58
00:04:21,310 --> 00:04:25,330
‫And inside that folder we're going to search for Sky.

59
00:04:25,390 --> 00:04:29,170
‫Now what we want is this BP sky sphere.

60
00:04:29,170 --> 00:04:37,420
‫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

61
00:04:37,450 --> 00:04:46,960
‫a sphere here that is absolutely massive and basically simulates the far off distant sky in the clouds

62
00:04:46,960 --> 00:04:48,610
‫and the sun in the sky.

63
00:04:48,700 --> 00:04:55,360
‫So that is what our skylight is trying to capture the light for that.

64
00:04:55,360 --> 00:05:02,170
‫So we need to click on the skylight and we need to go scroll down to a property called Recapture Scene

65
00:05:02,170 --> 00:05:03,250
‫and we click on Recap.

66
00:05:03,340 --> 00:05:03,580
‫You.

67
00:05:04,550 --> 00:05:13,070
‫And you can see that the light now gets updated to represent that kind of soft twilight that is illuminating

68
00:05:13,070 --> 00:05:14,930
‫everything a little bit evenly.

69
00:05:14,930 --> 00:05:16,250
‫And that's what we wanted.

70
00:05:16,250 --> 00:05:18,220
‫And you can see inside, it's still quite dark.

71
00:05:18,230 --> 00:05:24,500
‫We've only got a little bit of light spilling in from the outside, but it's given us a nice soft ambient

72
00:05:24,500 --> 00:05:24,770
‫light.

73
00:05:24,770 --> 00:05:31,790
‫So typically what happens is that we will put the skylight and the sky sphere together and also have

74
00:05:31,790 --> 00:05:35,150
‫a directional light on top of this as well.

75
00:05:35,270 --> 00:05:43,070
‫And we can set the direction of that light as we see fit by just kind of rotating it around like this.

76
00:05:43,070 --> 00:05:49,460
‫And if we then go back and select our Sky Sphere blueprint and look at the details pane for it, you

77
00:05:49,460 --> 00:05:57,650
‫can see that there is a link that it could want to a directional light actor so we can select this asset

78
00:05:57,800 --> 00:06:02,750
‫by selecting the actor in our scene to pick that directional light.

79
00:06:02,750 --> 00:06:04,070
‫And you can see that instantly.

80
00:06:04,070 --> 00:06:10,070
‫What it has done is it's changed to a much brighter daytime and the sun is high up in the sky.

81
00:06:10,160 --> 00:06:16,310
‫And that's because by linking those two in together, what we've said is that the sky sphere should

82
00:06:16,310 --> 00:06:19,220
‫match the angle of this directional light.

83
00:06:19,220 --> 00:06:25,850
‫So if I put the angle of the light really low, the sun hasn't quite updated because we'd need to go

84
00:06:25,850 --> 00:06:32,690
‫in to our BP sky actor and hit refresh material, which then redraws it.

85
00:06:32,690 --> 00:06:33,680
‫And you can see the sun.

86
00:06:33,860 --> 00:06:38,810
‫Sun is now low in the sky and the color of the sky has been automatically updated.

87
00:06:38,810 --> 00:06:41,180
‫So these two things being linked together is a really good thing.

88
00:06:41,180 --> 00:06:44,210
‫It makes them physically much more accurate.

89
00:06:44,210 --> 00:06:51,050
‫So I'm just going to put it back to the sun being reasonably high up in the sky, and then we can go

90
00:06:51,050 --> 00:06:54,380
‫to our BP sky sphere and just refresh its material one more time.

91
00:06:54,380 --> 00:06:58,640
‫Now, these actors haven't gone in the global folder yet, so let's go drag them in there.

92
00:06:58,640 --> 00:07:05,000
‫And these are all the things that apply at a global level, so it just allows us to tuck them away nice

93
00:07:05,000 --> 00:07:05,870
‫and neatly.

94
00:07:05,870 --> 00:07:10,220
‫So I'd like to challenge you to add some sunlight to your own scene.

95
00:07:10,220 --> 00:07:17,540
‫So you're going to add a sky sphere, add a direction light and a skylight and link them together,

96
00:07:17,540 --> 00:07:23,360
‫as I've just done so that when you move the direction light, it can update the material for the sky

97
00:07:23,360 --> 00:07:31,160
‫sphere and the sky light then can recapture the light from that skysphere and change the rotation of

98
00:07:31,160 --> 00:07:31,580
‫the sun.

99
00:07:31,670 --> 00:07:34,220
‫Maybe you want a different mood to your game.

100
00:07:34,220 --> 00:07:41,060
‫Mine's more high in the sky, but you might want a lower sun to represent a later time in the day.

101
00:07:41,060 --> 00:07:43,460
‫Pause the video and have a go.

102
00:07:46,750 --> 00:07:47,230
‫Okay.

103
00:07:47,230 --> 00:07:47,830
‫Welcome back.

104
00:07:47,830 --> 00:07:48,100
‫So.

105
00:07:48,100 --> 00:07:50,050
‫Well, this is how I've got it at the moment.

106
00:07:50,050 --> 00:07:55,270
‫The only thing I want to check is the skylight looks quite orange, so I'm guessing we haven't recaptured

107
00:07:55,270 --> 00:07:56,140
‫the skylight.

108
00:07:56,140 --> 00:08:02,260
‫So I'm going to the skylight and then scrolling on down to where it says recapture.

109
00:08:02,470 --> 00:08:03,130
‫I hit recapture.

110
00:08:03,130 --> 00:08:09,730
‫Now you can see the skylight has gone far more blue in the shadows, and that's because the reflected

111
00:08:09,730 --> 00:08:16,780
‫atmospheric light in our skysphere is more blue because of the sun being higher and the rays not getting

112
00:08:16,780 --> 00:08:19,150
‫scattered and all that kind of physical goodness.

113
00:08:19,150 --> 00:08:23,050
‫Now you may notice that some of the shadows here are looking rather strange.

114
00:08:23,050 --> 00:08:24,130
‫Don't worry about this just yet.

115
00:08:24,130 --> 00:08:26,020
‫We are going to fix this in a later lecture.

116
00:08:26,020 --> 00:08:27,190
‫So that's it for this lecture.

117
00:08:27,190 --> 00:08:33,160
‫We've looked over the different types of light that we can have in our scene and the most complex set

118
00:08:33,160 --> 00:08:35,650
‫up being how we do sunlight.

119
00:08:35,650 --> 00:08:37,450
‫I'll see you in the next lecture.

