﻿1
00:00:04,220 --> 00:00:05,360
‫Hello and welcome.

2
00:00:05,360 --> 00:00:11,930
‫In this lecture, we're going to be making the inside of our dungeon completely pitch black by adding

3
00:00:11,930 --> 00:00:18,380
‫some panels around the outside to essentially block out any light from bleeding in to the dungeon.

4
00:00:18,380 --> 00:00:23,390
‫This is a preparatory step for the next one, which is going to be to actually light the dungeon.

5
00:00:23,390 --> 00:00:26,120
‫So let's dive in and see how this works.

6
00:00:26,510 --> 00:00:32,390
‫So when we were playing around with lighting in the last level, you may have seen that we instantly

7
00:00:32,390 --> 00:00:39,290
‫got some updates to the lighting and if we brought in objects, we could instantly see the effects of

8
00:00:39,290 --> 00:00:39,890
‫those lights.

9
00:00:39,890 --> 00:00:42,440
‫And there's lots of scattered and soft bounce lighting.

10
00:00:42,530 --> 00:00:46,910
‫And this is due to a new development in Unreal five called Lumen.

11
00:00:46,910 --> 00:00:53,900
‫It's a real time global illumination light engine and because it's fairly new, there are still some

12
00:00:54,080 --> 00:00:59,930
‫features that are not supported in Lumen and you can see this going on with this material on the wall.

13
00:00:59,960 --> 00:01:03,020
‫You can see how it's kind of got this weird shadowing effect.

14
00:01:03,020 --> 00:01:08,750
‫Well, this is because there are some features being used in its material that are not supported yet

15
00:01:08,750 --> 00:01:09,350
‫by Lumen.

16
00:01:09,350 --> 00:01:15,950
‫So what we need to do is we need to edit this material and we can find the material for this particular

17
00:01:15,950 --> 00:01:16,700
‫segment.

18
00:01:16,700 --> 00:01:18,830
‫Like, so click on the wall.

19
00:01:18,830 --> 00:01:22,610
‫Let's go down to the area where it says materials.

20
00:01:23,330 --> 00:01:28,640
‫And under the materials you can see we've got this stone wall insert.

21
00:01:29,240 --> 00:01:35,150
‫If we select that in the content browser and we scroll down to the stone wall what it means by insert,

22
00:01:35,150 --> 00:01:38,270
‫what does it mean by having that underscore insert at the end?

23
00:01:38,270 --> 00:01:42,140
‫Basically what it's saying is this is not actually the material itself.

24
00:01:42,140 --> 00:01:44,060
‫It doesn't tell it how to render the material.

25
00:01:44,060 --> 00:01:51,500
‫It's just essentially like a blueprint of the material that tells it which textures to use and other

26
00:01:51,500 --> 00:01:52,250
‫settings.

27
00:01:52,250 --> 00:01:57,860
‫So what we need to do is right click on it and click Find Parent.

28
00:01:57,860 --> 00:02:00,710
‫And if we click Find Parent, then open the content draw again.

29
00:02:00,710 --> 00:02:04,010
‫You can see we've got this m tiling master hovering over.

30
00:02:04,010 --> 00:02:09,860
‫That does show us that this is indeed a material this is the master material that the other materials

31
00:02:09,860 --> 00:02:10,850
‫are made from.

32
00:02:10,850 --> 00:02:15,530
‫So we can click this to open it up and we now get the material.

33
00:02:15,530 --> 00:02:19,250
‫Editor It's very much like a blueprint editor.

34
00:02:19,250 --> 00:02:22,970
‫You can see there's all these nodes here except we don't have an execution pin.

35
00:02:23,000 --> 00:02:24,710
‫These are all just data pins.

36
00:02:24,740 --> 00:02:27,950
‫It doesn't really matter as to how this works.

37
00:02:27,950 --> 00:02:29,150
‫Exactly.

38
00:02:29,150 --> 00:02:32,930
‫The important thing is that all the output data is going into this node at the end.

39
00:02:32,930 --> 00:02:38,600
‫And one of the things that isn't supported in Lumen is this pixel depth offset.

40
00:02:38,600 --> 00:02:44,420
‫We basically can't use that, so we need to disconnect it and we can do that by clicking on the pin.

41
00:02:44,450 --> 00:02:45,470
‫It can go away.

42
00:02:45,470 --> 00:02:53,150
‫Then we go to the toolbar and hit Apply and it's going to go ahead and recompile the material code,

43
00:02:53,150 --> 00:02:56,480
‫recompile the shaders and have that available in our level.

44
00:02:56,480 --> 00:03:02,060
‫Now if we go over into the dungeon, you can see that weird shadow effect has gone away and we've got

45
00:03:02,060 --> 00:03:03,560
‫a better looking level.

46
00:03:03,560 --> 00:03:07,040
‫So now it's time to start lighting the interior of our level.

47
00:03:07,040 --> 00:03:13,250
‫You can see there's a lot of light bleeding in to this interior of the level and that is because actually

48
00:03:13,250 --> 00:03:21,410
‫our ceiling is a one sided mesh and so light's kind of coming through in to the room and we'd see this

49
00:03:21,410 --> 00:03:27,260
‫even more if we do the following, because Lumen is a real time system.

50
00:03:27,290 --> 00:03:31,400
‫It really works best when we use real time lights.

51
00:03:31,400 --> 00:03:32,660
‫And what do I mean by that?

52
00:03:32,660 --> 00:03:38,990
‫Well, if we go to our global folder and select the directional light and have a look in the details

53
00:03:38,990 --> 00:03:46,190
‫pane, you can see that there is a mobility setting here and this basically tells Unreal whether we

54
00:03:46,190 --> 00:03:50,750
‫intend to move or modify this object when the game is playing.

55
00:03:50,750 --> 00:03:57,050
‫So static means know nothing is going to change about this object full stop and that allows unreal to

56
00:03:57,050 --> 00:04:01,100
‫bake in a lot of things like lighting settings before you play the game.

57
00:04:01,100 --> 00:04:06,740
‫There's stationary which says you can't move it, but you can change things like the brightness and

58
00:04:06,740 --> 00:04:09,620
‫then there's movable, which basically means anything could change.

59
00:04:09,860 --> 00:04:16,310
‫Now, funnily enough, Lumen, the new unreal lighting system works best when your lights are set to

60
00:04:16,310 --> 00:04:17,120
‫be movable.

61
00:04:17,120 --> 00:04:22,460
‫So if we switch our directional light to movable, you can instantly see the problem here that essentially

62
00:04:22,460 --> 00:04:27,830
‫the light is just coming straight through the ceiling panels because from the lights point of view,

63
00:04:27,830 --> 00:04:30,020
‫they aren't there, they are one sided.

64
00:04:30,020 --> 00:04:36,050
‫And so it doesn't actually create any shadow in here and we can do the same thing, sets the other light

65
00:04:36,050 --> 00:04:38,750
‫in our scene to move ball, which is the skylight.

66
00:04:38,750 --> 00:04:41,870
‫And that's just going to compute all of our lights in real time.

67
00:04:41,910 --> 00:04:45,170
‫That's much easier to deal with lighting.

68
00:04:45,170 --> 00:04:47,990
‫When we're doing everything in real time, we're using lumen.

69
00:04:47,990 --> 00:04:52,520
‫So let's start having a look at how we can block out the light here.

70
00:04:52,520 --> 00:04:58,700
‫I think one of the easiest ways to do this is actually just to take the floor meshes and lift them up

71
00:04:58,700 --> 00:05:02,270
‫to be a roof over the top of our dungeon.

72
00:05:02,270 --> 00:05:03,200
‫That's certainly one way we.

73
00:05:03,330 --> 00:05:03,820
‫Into it.

74
00:05:03,830 --> 00:05:11,240
‫So I'm going to go ahead and search the outline of the floor and then look in the dungeon folder and

75
00:05:11,240 --> 00:05:13,510
‫just select the dungeon floor elements.

76
00:05:13,520 --> 00:05:23,660
‫Then I'm going to go to the four pane view and I'm going to pull the floor up while clicking to duplicate

77
00:05:23,660 --> 00:05:28,010
‫it and bring it up to a level where it can be as ceiling.

78
00:05:28,010 --> 00:05:34,880
‫Here, if we go inside, I just want to check that it is indeed blocking out the light effectively and

79
00:05:34,880 --> 00:05:36,110
‫it seems like it is.

80
00:05:36,110 --> 00:05:41,120
‫If you bring it too close, then you can get some light bleeding in.

81
00:05:41,270 --> 00:05:44,930
‫So we don't want it to close, but we do want it just close enough.

82
00:05:44,930 --> 00:05:50,840
‫Like so perhaps so they would go and knock out any light bleeding into this room except from these corners.

83
00:05:50,840 --> 00:05:55,820
‫And if you pop out, you can see why the edges are not quite meeting the top here.

84
00:05:55,850 --> 00:06:02,090
‫So what we need to do there is put some of that edging meshes around there.

85
00:06:02,090 --> 00:06:06,740
‫So if we look for Edge in our medieval dungeon, we've got the edge stones.

86
00:06:06,740 --> 00:06:15,110
‫Let's drag those in and place them next to these objects and duplicate it along.

87
00:06:15,140 --> 00:06:22,400
‫Maybe changing the grid, snap setting to be one meter and we'll duplicate and duplicate again.

88
00:06:22,790 --> 00:06:27,200
‫And we've got ourselves hopefully the light being blocked inside our dungeon.

89
00:06:27,200 --> 00:06:27,500
‫Yep.

90
00:06:27,510 --> 00:06:30,170
‫Looks like it's being blocked quite effectively.

91
00:06:30,170 --> 00:06:36,350
‫And just for completeness sake, I'm going to take these three edge stones, select them and duplicate

92
00:06:36,350 --> 00:06:44,720
‫them over to the other side like so, and then rotate them 90 degrees with a duplicate and then duplicate

93
00:06:44,720 --> 00:06:46,820
‫it on over here as well.

94
00:06:46,820 --> 00:06:48,350
‫So you can see that inside.

95
00:06:48,350 --> 00:06:51,050
‫Now we've got a very, very dark dungeon.

96
00:06:51,050 --> 00:06:54,830
‫And if you wanted to check that, we can indeed illuminate it at all.

97
00:06:54,830 --> 00:07:02,390
‫Then we could just go to our quickly add go to lights and drag in a point light to see the effect of

98
00:07:02,390 --> 00:07:03,950
‫illuminating the dungeon.

99
00:07:03,950 --> 00:07:06,620
‫So I'd like to challenge you to block out the light.

100
00:07:06,620 --> 00:07:08,240
‫So you've seen how I've been doing it.

101
00:07:08,240 --> 00:07:12,140
‫Add floor and edge stones around the whole of your corridors.

102
00:07:12,140 --> 00:07:18,770
‫You may need to rotate them so that you can cover some of the rounded areas, for example, around that

103
00:07:18,770 --> 00:07:19,610
‫mausoleum.

104
00:07:19,700 --> 00:07:24,260
‫And you might also want to check that all your corridors are dark once you've finished and there's no

105
00:07:24,260 --> 00:07:28,880
‫light bleeding in from any places, you need to cover them all up, make it all dark.

106
00:07:28,880 --> 00:07:35,420
‫So pause the video and have a go and remember that you can use the unlit mode to move around when things

107
00:07:35,420 --> 00:07:36,080
‫are dark.

108
00:07:36,080 --> 00:07:37,610
‫So pause a video and have a go.

109
00:07:40,770 --> 00:07:40,980
‫Okay.

110
00:07:41,070 --> 00:07:41,770
‫Welcome back.

111
00:07:41,790 --> 00:07:46,610
‫So let's remove this light from our scene because we don't need it.

112
00:07:46,620 --> 00:07:49,800
‫We just want to see whether we're making everything nice and dark.

113
00:07:49,920 --> 00:07:54,720
‫So what I'm noticing here is we've got the edge stone here that we don't really need because the edge

114
00:07:54,720 --> 00:07:57,390
‫is actually over here at the end of the staircase.

115
00:07:57,390 --> 00:07:58,740
‫It's a bit of a funny shape.

116
00:07:58,830 --> 00:08:03,830
‫So let's go ahead and move that edge along.

117
00:08:03,840 --> 00:08:10,770
‫Then I'm going to copy a couple of edge stones from the already built section and duplicate them to

118
00:08:10,770 --> 00:08:17,490
‫the other side of this corridor and select a couple of floor panels and move those along to.

119
00:08:17,520 --> 00:08:22,470
‫Now, switching into unlit mode, let's go and position ourselves so we can see the staircase.

120
00:08:22,470 --> 00:08:28,260
‫Then switch back to lit and you can see that the staircase is looking pretty dark in here.

121
00:08:28,260 --> 00:08:32,880
‫We just need to cover up the crypt area now.

122
00:08:32,880 --> 00:08:36,090
‫So we're going to select all of that crypt flooring.

123
00:08:36,090 --> 00:08:40,860
‫So I'm doing that by searching the outline of a crypt floor and then selecting all of it.

124
00:08:40,890 --> 00:08:46,890
‫And I think I just need to be careful to deselect these two bits of floor at the start of the staircase.

125
00:08:46,890 --> 00:08:51,360
‫And it looks like there's this crypt floor wall trim to deselect as well.

126
00:08:51,390 --> 00:08:58,320
‫Then when I'm confident it's all at the same level, I'm going to alt and drag it up to make a duplicate.

127
00:08:58,350 --> 00:09:05,490
‫Looks like I may need to change the grid snapping b 50 because of the height of the ceiling.

128
00:09:05,520 --> 00:09:07,500
‫Then I can bring it up one level more.

129
00:09:07,530 --> 00:09:13,560
‫Now if I switch to unlit mode, I can position myself inside the corridor to have a little look go to

130
00:09:13,560 --> 00:09:17,460
‫lit and I can see that it's starting to look quite dark.

131
00:09:17,460 --> 00:09:24,690
‫These architraves have got a bit of light bleeding, so I think I just need to position them a probably

132
00:09:24,690 --> 00:09:30,030
‫ten centimetres higher altogether so there's not any light bleeding from those architraves and then

133
00:09:30,030 --> 00:09:33,390
‫any of the edge that doesn't quite match up here.

134
00:09:33,750 --> 00:09:38,130
‫We're going to have to put some edging stone around that.

135
00:09:38,130 --> 00:09:45,780
‫So let me just go and check that we've got a little bit of an issue here where light's being let in

136
00:09:45,780 --> 00:09:52,710
‫from the back side of this decorative wall and also from the back side of these mausoleum meshes.

137
00:09:52,710 --> 00:10:01,470
‫So let's try and fix that by duplicating some roof and maybe rotating it down to cover this piece that

138
00:10:01,470 --> 00:10:03,300
‫was bleeding light.

139
00:10:03,300 --> 00:10:08,400
‫And if we want to be safe and have some margin for error, we could actually copy two of them across

140
00:10:08,400 --> 00:10:12,120
‫here so that there is absolutely no way light's coming in there.

141
00:10:12,120 --> 00:10:17,040
‫And we probably want to do roughly about the same thing with our mausoleum.

142
00:10:17,040 --> 00:10:24,900
‫Duplicate some wall down here, rotate it about 90 degrees, and then I'm actually going to duplicate

143
00:10:24,900 --> 00:10:27,660
‫it to be higher as well.

144
00:10:27,660 --> 00:10:33,960
‫And the flooring does need to be higher up on the mausoleum to let the whole roof fit.

145
00:10:33,960 --> 00:10:40,110
‫And I think these walls need to be a smidge further out to not include some of this mesh.

146
00:10:40,160 --> 00:10:45,450
‫Looks like we've still got some light coming in from somewhere, so I'm just going to duplicate a couple

147
00:10:45,450 --> 00:10:47,940
‫more panels like so.

148
00:10:47,940 --> 00:10:54,330
‫And along the top to switch to unlit, let's go inside the mausoleum and have a little look around back

149
00:10:54,330 --> 00:10:55,140
‫to lit.

150
00:10:55,140 --> 00:10:55,560
‫Okay.

151
00:10:55,560 --> 00:10:58,110
‫Looks like it's just the edging stones to do now.

152
00:10:58,110 --> 00:11:02,610
‫Or actually because this area is not going to be visible from the exterior, it doesn't matter how it

153
00:11:02,610 --> 00:11:03,030
‫looks.

154
00:11:03,030 --> 00:11:09,120
‫So we can just add some extra flooring like this and just make it extra wide.

155
00:11:09,160 --> 00:11:12,480
‫Then inside you can see that there's no bleeding going on.

156
00:11:12,480 --> 00:11:18,930
‫So we can do that same procedure with the rest of the corridor, move some of it slightly across, and

157
00:11:18,930 --> 00:11:22,460
‫then the rest over to the right switch to unlit check.

158
00:11:22,470 --> 00:11:29,310
‫I'm inside the corridor and then back to lit and everywhere, apart from that door is looking completely

159
00:11:29,310 --> 00:11:30,120
‫pitch black.

160
00:11:30,120 --> 00:11:31,230
‫Is that true?

161
00:11:31,260 --> 00:11:34,110
‫Even when I'm looking up the staircase, I wonder.

162
00:11:34,110 --> 00:11:36,450
‫Let's have a look at the staircase.

163
00:11:37,170 --> 00:11:38,670
‫Hit lit.

164
00:11:39,390 --> 00:11:39,670
‫Yeah.

165
00:11:39,690 --> 00:11:41,550
‫It's looking pretty dark in here.

166
00:11:41,550 --> 00:11:42,990
‫Very, very dark indeed.

167
00:11:42,990 --> 00:11:43,620
‫So there we go.

168
00:11:43,620 --> 00:11:50,160
‫We've effectively blocked out any light bleed that we were getting inside our dungeon, which will set

169
00:11:50,160 --> 00:11:54,240
‫the stage for lighting it properly in the next video.

170
00:11:54,240 --> 00:11:55,080
‫I'll see you there.

