Would you like to inspect the original subtitles? These are the user uploaded subtitles that are being translated:
1
00:00:00,800 --> 00:00:01,533
in this lesson
2
00:00:01,533 --> 00:00:05,000
we're gonna learn about the limits of light diffraction
3
00:00:05,000 --> 00:00:08,266
which causes glows around bright areas
4
00:00:08,800 --> 00:00:10,000
so here's where we left off
5
00:00:10,000 --> 00:00:12,100
when we have our flares in place
6
00:00:12,300 --> 00:00:13,800
now these ultra bright areas
7
00:00:13,800 --> 00:00:16,800
in the real world would be causing some kind of glow
8
00:00:17,100 --> 00:00:20,166
now let's take a look at the actual physics behind this
9
00:00:20,166 --> 00:00:22,033
because it's actually rather interesting
10
00:00:22,966 --> 00:00:23,866
you recall earlier
11
00:00:23,866 --> 00:00:25,800
we talked about diffraction
12
00:00:25,800 --> 00:00:29,666
in that when light hits a closed or a tight opening
13
00:00:29,666 --> 00:00:32,666
it begins to spread out like waves in a pond
14
00:00:32,666 --> 00:00:36,000
so the result of this is that light is not coming in
15
00:00:36,000 --> 00:00:38,500
as a uh almost a dot
16
00:00:38,500 --> 00:00:41,966
what it comes in as is an airy disc
17
00:00:42,000 --> 00:00:43,333
and this is what it looks like
18
00:00:43,333 --> 00:00:45,700
so you can see here we have a very bright center
19
00:00:45,700 --> 00:00:48,033
and then we have these waves around it
20
00:00:48,100 --> 00:00:48,900
now you might be thinking
21
00:00:48,900 --> 00:00:51,100
why don't we see this at all times
22
00:00:51,100 --> 00:00:52,366
and the answer is
23
00:00:52,400 --> 00:00:57,166
the edge rings of the airy disc are very very dark
24
00:00:57,366 --> 00:00:58,466
so in other words
25
00:00:58,466 --> 00:01:02,066
the amount of energy in these discs is very low
26
00:01:02,066 --> 00:01:03,266
so most of the time
27
00:01:03,266 --> 00:01:07,466
they are overpowered by the surrounding light however
28
00:01:07,466 --> 00:01:10,466
if the original energy in the light is strong enough
29
00:01:10,466 --> 00:01:12,200
we're gonna see these discs
30
00:01:12,200 --> 00:01:15,000
and that is what causes the glowing effect
31
00:01:15,666 --> 00:01:16,800
and we can see this easily
32
00:01:16,800 --> 00:01:19,166
if we take a look at a photograph right here
33
00:01:19,166 --> 00:01:22,000
so we can see the edge of this is very sharp
34
00:01:22,000 --> 00:01:25,066
but wherever we have an incredible amount of light
35
00:01:25,166 --> 00:01:29,500
the airy disc is actually causing the light to spread
36
00:01:29,500 --> 00:01:31,566
and cover everything around it
37
00:01:31,566 --> 00:01:32,766
and this is what causes
38
00:01:32,766 --> 00:01:35,366
the glows we see from very bright lights
39
00:01:35,700 --> 00:01:38,566
now I found this image from a popular Hollywood movie
40
00:01:38,566 --> 00:01:39,966
and you can clearly see
41
00:01:39,966 --> 00:01:43,333
the airy disc right here on this uh light
42
00:01:43,333 --> 00:01:44,533
and it's actually quite amazing
43
00:01:44,533 --> 00:01:47,800
you can actually see the various rings around this
44
00:01:47,900 --> 00:01:50,400
so how are we going to create this inside of nuke
45
00:01:50,400 --> 00:01:52,366
well there's quite a few different ways
46
00:01:52,400 --> 00:01:55,300
the easiest way and the fastest way is just add
47
00:01:55,533 --> 00:01:56,733
uh some glows
48
00:01:56,733 --> 00:01:59,433
so let's uh add in a few glow notes here
49
00:02:00,900 --> 00:02:02,066
and the glow node
50
00:02:02,066 --> 00:02:05,600
uh is a rough approximation of the airy disc
51
00:02:05,600 --> 00:02:06,766
so we can see here
52
00:02:06,766 --> 00:02:09,600
that our entire image becomes much softer
53
00:02:09,766 --> 00:02:12,166
and so we probably wanna increase the tolerance a
54
00:02:12,166 --> 00:02:14,466
bit on this so that we're only glowing
55
00:02:14,466 --> 00:02:16,733
the brightest areas of our image
56
00:02:16,733 --> 00:02:18,700
so I'm gonna increase the tolerance to about
57
00:02:18,700 --> 00:02:20,200
point nine four
58
00:02:20,900 --> 00:02:22,366
now this is an okay glow
59
00:02:22,366 --> 00:02:24,933
but again I like to layer on these effects
60
00:02:24,933 --> 00:02:28,366
so I'm gonna turn this mix down to point three three
61
00:02:28,366 --> 00:02:31,400
and then copy this three more times
62
00:02:31,700 --> 00:02:33,566
and on each of these different copies
63
00:02:33,566 --> 00:02:35,200
let's go in and let's change the
64
00:02:35,200 --> 00:02:37,166
size of our glow a little bit
65
00:02:37,166 --> 00:02:39,933
so maybe on glow 2 we reduce the size
66
00:02:39,933 --> 00:02:42,533
and on glow 3 we increase the size
67
00:02:42,533 --> 00:02:44,700
so we've got a normal glow
68
00:02:45,466 --> 00:02:47,366
and then we have a smaller glow
69
00:02:47,366 --> 00:02:49,900
and finally a large glow
70
00:02:51,400 --> 00:02:54,233
and you can see that gives us a pretty nice effect
71
00:02:54,366 --> 00:02:55,866
now if you're not too worried about this
72
00:02:55,866 --> 00:02:57,133
we can stop here
73
00:02:57,133 --> 00:02:58,766
but if we wanna actually
74
00:02:58,766 --> 00:03:01,966
uh mimic the physics in a much more accurate way
75
00:03:01,966 --> 00:03:05,466
we can do that inside of nuke using something called
76
00:03:05,500 --> 00:03:07,266
uh convolution
77
00:03:07,733 --> 00:03:11,500
now we have a node to do this called the convalve node
78
00:03:11,500 --> 00:03:13,466
but it runs rather slow
79
00:03:13,733 --> 00:03:17,633
and the point of the convalve node is to take an image
80
00:03:17,666 --> 00:03:18,500
and then essentially
81
00:03:18,500 --> 00:03:21,566
use that image as a template or a base
82
00:03:21,566 --> 00:03:24,466
for every single pixel inside of our image
83
00:03:25,266 --> 00:03:27,500
so let's just quickly look at what
84
00:03:27,600 --> 00:03:31,066
this would do if we just added in a simple radial
85
00:03:31,100 --> 00:03:33,166
so I'm gonna add in a simple radial
86
00:03:33,166 --> 00:03:36,500
and let's give this a pretty small size
87
00:03:36,666 --> 00:03:39,900
uh I'm gonna go and give it a width of 1 hundred oops
88
00:03:39,900 --> 00:03:42,166
a width of 100 and a height of 100
89
00:03:42,466 --> 00:03:44,233
so we can see our radial there
90
00:03:44,466 --> 00:03:46,400
and let's convolve this
91
00:03:46,400 --> 00:03:47,766
to our original image
92
00:03:47,766 --> 00:03:49,600
so I'm gonna plug our B pipe into
93
00:03:49,600 --> 00:03:52,900
our original comp and the a pipe into this radial
94
00:03:53,000 --> 00:03:54,466
and if we take a look at this
95
00:03:54,466 --> 00:03:57,933
you can see it is now copying or using that radial
96
00:03:57,933 --> 00:04:00,400
for every single pixel in our image
97
00:04:00,700 --> 00:04:02,966
now it's gonna be incredibly blurry
98
00:04:02,966 --> 00:04:04,266
and this is one
99
00:04:04,266 --> 00:04:06,766
possible consequence of using the convolved
100
00:04:06,766 --> 00:04:08,566
notice we have to be careful where
101
00:04:08,566 --> 00:04:10,466
we're applying it now
102
00:04:10,466 --> 00:04:11,266
as I said before
103
00:04:11,266 --> 00:04:13,066
this is a little bit slow
104
00:04:13,066 --> 00:04:15,966
so uh the new community is actually created a
105
00:04:15,966 --> 00:04:19,066
gizmo that we can use to make this much faster
106
00:04:19,066 --> 00:04:21,766
and they've also created some wonderful
107
00:04:21,800 --> 00:04:25,000
uh convolution sources for us to use
108
00:04:26,000 --> 00:04:27,600
so I'm gonna jump back to my browser
109
00:04:27,600 --> 00:04:30,133
and it's currently on Wikipedia dot com
110
00:04:30,133 --> 00:04:31,700
you can see the link here
111
00:04:31,700 --> 00:04:33,833
or you can search for this in
112
00:04:33,900 --> 00:04:35,000
uh your favourite
113
00:04:35,000 --> 00:04:37,600
uh webman or search engine of choice
114
00:04:37,766 --> 00:04:39,000
and what this is now doing is
115
00:04:39,000 --> 00:04:41,866
it's using something called a fast Ferrier transform
116
00:04:41,866 --> 00:04:43,966
which really I'm not going to get into
117
00:04:43,966 --> 00:04:47,200
but it's a slightly faster way of using these
118
00:04:47,200 --> 00:04:49,266
images to replace the pixels
119
00:04:49,266 --> 00:04:50,600
in our comp
120
00:04:50,800 --> 00:04:53,400
now uh uh this gentleman
121
00:04:53,400 --> 00:04:54,400
Bob Roastler
122
00:04:54,400 --> 00:04:57,333
has been nice enough to actually process some very
123
00:04:57,333 --> 00:04:58,933
small convolution images
124
00:04:58,933 --> 00:05:00,433
and has put them up for download
125
00:05:00,466 --> 00:05:02,400
so if you have an account here at Wikipedia
126
00:05:02,400 --> 00:05:03,433
which is free
127
00:05:03,466 --> 00:05:05,266
you can go to the footage
128
00:05:05,266 --> 00:05:06,366
and then down here
129
00:05:06,366 --> 00:05:08,366
we have some lens kernels
130
00:05:08,400 --> 00:05:09,300
so I've already gone in
131
00:05:09,300 --> 00:05:10,966
and downloaded these three kernels
132
00:05:10,966 --> 00:05:12,466
as well as downloaded
133
00:05:12,466 --> 00:05:13,766
this nuke gizmo
134
00:05:13,766 --> 00:05:16,133
so let's take a look at how we can use this now
135
00:05:16,133 --> 00:05:18,366
to create a much more realistic
136
00:05:18,366 --> 00:05:19,900
diffraction effect
137
00:05:20,666 --> 00:05:22,133
alright so we have our convolve
138
00:05:22,133 --> 00:05:23,733
and we have our normal glow
139
00:05:23,733 --> 00:05:26,300
and I'm just gonna move these over here to the left
140
00:05:26,533 --> 00:05:29,000
and what we can do is we can go to file and we
141
00:05:29,000 --> 00:05:30,833
can import a new script
142
00:05:31,400 --> 00:05:33,700
and I've downloaded those to my local system
143
00:05:33,700 --> 00:05:35,666
and we're not gonna be able to redistribute these
144
00:05:35,666 --> 00:05:37,100
but again you can download these
145
00:05:37,100 --> 00:05:39,266
for free on Wikipedia dot com
146
00:05:39,333 --> 00:05:39,900
so I'm gonna
147
00:05:39,900 --> 00:05:40,933
import this gizmo
148
00:05:40,933 --> 00:05:42,166
let's open this up
149
00:05:42,266 --> 00:05:43,100
oopsie Daisy
150
00:05:43,100 --> 00:05:44,566
let's go back to file
151
00:05:44,566 --> 00:05:45,700
import script
152
00:05:47,600 --> 00:05:48,166
there we go
153
00:05:48,166 --> 00:05:51,033
so now we have our lens kernel FFT
154
00:05:51,566 --> 00:05:52,533
now before we use this
155
00:05:52,533 --> 00:05:54,466
we have to connect in our various kernels
156
00:05:54,466 --> 00:05:56,766
so I'm gonna go over here and uh again
157
00:05:56,766 --> 00:05:59,466
I've downloaded these three kernels that he's uh
158
00:05:59,466 --> 00:06:01,733
been so generous enough to include
159
00:06:01,733 --> 00:06:03,566
so we have our 1.4
160
00:06:03,800 --> 00:06:07,800
our 2.8 and are 5.6
161
00:06:07,800 --> 00:06:08,666
and those are
162
00:06:08,733 --> 00:06:11,366
uh just different kernels at different focal lengths
163
00:06:11,366 --> 00:06:13,966
so that they have slightly different profiles
164
00:06:15,133 --> 00:06:16,500
now this is actually quite interesting
165
00:06:16,500 --> 00:06:18,900
and it kind of shows us the airy disc
166
00:06:18,966 --> 00:06:20,000
uh in the real world
167
00:06:20,000 --> 00:06:22,466
so let's take a look at one of these uh files
168
00:06:22,466 --> 00:06:26,000
and we can see here that it has nothing in it
169
00:06:26,133 --> 00:06:27,500
now that is actually not true
170
00:06:27,500 --> 00:06:28,533
if you hover over this
171
00:06:28,533 --> 00:06:30,366
you'll notice there are some very
172
00:06:30,366 --> 00:06:31,933
very small values
173
00:06:31,933 --> 00:06:34,600
if we totally increase our viewport here
174
00:06:34,600 --> 00:06:37,266
we can begin to see this airy disc
175
00:06:37,333 --> 00:06:39,900
and you can see it has a rather unique profile
176
00:06:39,933 --> 00:06:40,866
slightly different than
177
00:06:40,866 --> 00:06:43,566
the one that physics is telling us we're going to get
178
00:06:43,566 --> 00:06:45,866
and this is the great thing about the fraction is it's
179
00:06:45,866 --> 00:06:47,866
very lens specific
180
00:06:47,866 --> 00:06:48,766
so we can see here
181
00:06:48,766 --> 00:06:51,466
we have this very bright inner center here
182
00:06:51,466 --> 00:06:54,000
and then we have these wonderful rays
183
00:06:54,000 --> 00:06:55,366
of surrounding it
184
00:06:55,366 --> 00:06:56,900
so once we add this in
185
00:06:56,900 --> 00:06:58,866
we're gonna create a very subtle
186
00:06:58,866 --> 00:07:01,466
but very nice effect okay
187
00:07:01,466 --> 00:07:03,966
so with our lens kernel FFT
188
00:07:03,966 --> 00:07:06,166
let's plug this into our merge node
189
00:07:06,366 --> 00:07:08,166
and take a look at this now
190
00:07:08,366 --> 00:07:09,366
so if we come over here
191
00:07:09,366 --> 00:07:11,000
we can see we are now
192
00:07:11,166 --> 00:07:16,400
uh convolving or convoluting our image with this um
193
00:07:16,900 --> 00:07:18,866
a real life captured airy disc
194
00:07:18,866 --> 00:07:20,466
and we can see the difference is
195
00:07:20,500 --> 00:07:21,700
uh very subtle
196
00:07:21,700 --> 00:07:23,200
but it is quite pronounced
197
00:07:23,200 --> 00:07:24,100
so with our glows
198
00:07:24,100 --> 00:07:24,700
we get this
199
00:07:24,700 --> 00:07:25,566
it's kind of soft
200
00:07:25,566 --> 00:07:26,566
kind of fake
201
00:07:26,566 --> 00:07:27,966
uh but with our lens kernel
202
00:07:27,966 --> 00:07:30,733
you can see that we're getting this very nice glow that
203
00:07:30,733 --> 00:07:33,300
even adds in a little bit of chromatic aberration
204
00:07:33,300 --> 00:07:36,200
it begins smoothing everything out very nicely
205
00:07:36,500 --> 00:07:39,533
now one problem with using this is it's going to soften
206
00:07:39,533 --> 00:07:40,866
the entire image
207
00:07:40,866 --> 00:07:42,100
so we can see here
208
00:07:42,100 --> 00:07:44,900
we're losing quite a bit of definition
209
00:07:44,900 --> 00:07:46,400
by doing this
210
00:07:46,400 --> 00:07:49,566
so instead of directly applying it to the entire image
211
00:07:49,566 --> 00:07:53,166
what we recommend is applying it only to the
212
00:07:53,166 --> 00:07:55,100
bright areas of the image
213
00:07:55,566 --> 00:07:57,733
so again we can add in a Kia here
214
00:07:57,733 --> 00:07:59,233
so let's add in a Kia
215
00:07:59,900 --> 00:08:01,433
and let's plug this in
216
00:08:03,966 --> 00:08:06,533
and maybe let's give this a slightly softer key
217
00:08:06,533 --> 00:08:09,166
so uh maybe around there
218
00:08:09,933 --> 00:08:12,300
looks good so we're just convolving the
219
00:08:12,300 --> 00:08:14,400
brightest areas of our shot
220
00:08:14,766 --> 00:08:16,266
and then we just need to add it on
221
00:08:16,266 --> 00:08:17,866
back to our original image
222
00:08:17,866 --> 00:08:20,400
so let's take our lens kernel and our merge
223
00:08:20,400 --> 00:08:23,400
and hit the m key to merge those together
224
00:08:25,000 --> 00:08:26,000
and let's take a look at this
225
00:08:26,000 --> 00:08:27,166
let's just give ourselves a little
226
00:08:27,166 --> 00:08:28,466
bit more room to work
227
00:08:29,266 --> 00:08:31,600
and clean up this flow a little bit
228
00:08:31,600 --> 00:08:32,433
there we go
229
00:08:32,900 --> 00:08:35,900
and let's take a look at this merge and add it in
230
00:08:36,800 --> 00:08:39,566
now one thing we're gonna notice is that the
231
00:08:39,733 --> 00:08:41,833
uh overall energy or the
232
00:08:42,000 --> 00:08:44,400
uh brightness of our entire image has increased
233
00:08:44,400 --> 00:08:45,200
by doing this
234
00:08:45,200 --> 00:08:46,566
so we wanna be careful with that
235
00:08:46,566 --> 00:08:47,866
so what we can do is
236
00:08:48,000 --> 00:08:50,133
uh first we need to pre multiply
237
00:08:50,133 --> 00:08:53,033
the luminance key so that we are only
238
00:08:53,066 --> 00:08:55,233
modifying the brightest areas
239
00:08:55,600 --> 00:08:57,066
there we go so again
240
00:08:57,266 --> 00:09:01,033
our original and then our convolution added back on
241
00:09:02,100 --> 00:09:04,400
but we're still uh having it be much brighter
242
00:09:04,400 --> 00:09:07,333
so let's actually remove or subtract out
243
00:09:07,333 --> 00:09:09,200
the pre multiplied key
244
00:09:09,200 --> 00:09:12,366
before we add back on this lens kernel
245
00:09:12,466 --> 00:09:15,066
so I'm gonna hit m to drop in another merge node
246
00:09:15,066 --> 00:09:17,700
and connect the a pipe to my premult
247
00:09:17,800 --> 00:09:20,166
and then change the operation to from
248
00:09:20,200 --> 00:09:23,300
and what that is gonna do is it's going to subtract out
249
00:09:23,466 --> 00:09:25,800
the pre multiplied information
250
00:09:25,800 --> 00:09:27,600
so it's gonna subtract out
251
00:09:27,766 --> 00:09:29,900
the color that we're going to be
252
00:09:29,933 --> 00:09:32,233
uh fast for your transforming
253
00:09:32,266 --> 00:09:34,466
and what that gives us when we add it back in
254
00:09:34,466 --> 00:09:38,166
is a more consistent result with our original image
255
00:09:38,166 --> 00:09:39,700
so you can see here one
256
00:09:40,000 --> 00:09:42,300
two subtracted three
257
00:09:42,400 --> 00:09:44,166
uh added back in
258
00:09:44,166 --> 00:09:45,500
so what we're doing is we're essentially
259
00:09:45,500 --> 00:09:46,866
taking light out
260
00:09:47,066 --> 00:09:48,800
giving it the convolution or the fast
261
00:09:48,800 --> 00:09:49,933
for your transform
262
00:09:49,933 --> 00:09:51,966
and then adding it back on
263
00:09:52,300 --> 00:09:55,033
and what that gives us is this nice glow
264
00:09:55,200 --> 00:09:59,200
any uh or around all of our overly bright areas
265
00:09:59,900 --> 00:10:01,100
now before we end this lesson
266
00:10:01,100 --> 00:10:02,600
there's one thing I wanted to add
267
00:10:02,600 --> 00:10:03,800
I've noticed a little
268
00:10:03,800 --> 00:10:07,400
bit of instability with the lens kernel FFT
269
00:10:07,733 --> 00:10:10,200
without a crop node before it
270
00:10:10,200 --> 00:10:11,566
so before we do this
271
00:10:11,566 --> 00:10:12,700
let's make sure that we
272
00:10:12,700 --> 00:10:15,666
add a crop node before our luminance key
273
00:10:15,700 --> 00:10:19,400
and that will just ensure that the shape or the size
274
00:10:19,400 --> 00:10:22,066
of our lens kernel is consistent
275
00:10:22,366 --> 00:10:24,033
as it is being entered
276
00:10:24,133 --> 00:10:26,533
let's also make sure to turn off our black outside
277
00:10:26,533 --> 00:10:28,700
so that the FFT again
278
00:10:28,700 --> 00:10:31,100
has a consistent input
279
00:10:31,100 --> 00:10:33,166
so that we can use it correctly
280
00:10:33,766 --> 00:10:34,966
so just to wrap this up
281
00:10:34,966 --> 00:10:36,200
there's a lot of different ways
282
00:10:36,200 --> 00:10:38,366
you can create the diffraction effect
283
00:10:38,366 --> 00:10:39,933
you can create a few glows
284
00:10:39,933 --> 00:10:42,466
do that use the convolution node
285
00:10:42,500 --> 00:10:43,700
if you have a lens kernel
286
00:10:43,700 --> 00:10:45,766
or an image you would like to use
287
00:10:45,766 --> 00:10:47,733
or again use that nuke
288
00:10:47,733 --> 00:10:49,966
gizmo that's on Wikipedia dot com
289
00:10:49,966 --> 00:10:51,966
if you want to use accurate images
290
00:10:51,966 --> 00:10:53,833
and do it the right way the first time
20994
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.