Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
in this lesson
we're gonna learn about defocus
depth the field blur
Boca and spherical aberration
so here's where we left off
and we're getting really close to
finishing out all of our optical aberrations
so now let's take a look at one of the more common
aberration which is defocus
now defocus is one of those things that's so simple
it barely bears repeating
and that is when we are focusing on a specific
distance from our camera
objects that are further away
and closer will be out of focus
since we're focusing in on this
dessert right here
objects that are further away will begin to defocus
and that is
essentially in any photograph or any footage
now we call this depth of field blur or depth of field
and it's caused uh
partially by how wide your aperture is open
so in most cases
if your aperture is very wide open
say f 2 to f 5.6
you're probably going to get some depth of field blur
however as you close down your aperture
you're going to be extending your depth of field
therefore causing less blur
now there's two more words
we said Boca and sphere collaboration
Boca is the name for these
out of focus shapes that we get inside of our camera
and uh this is a Japanese term defining
how appealing this shape is
so here we can see we have a roughly circular Boca
and it is um
not very interesting
well here in this other photograph
you can see that our Boca is many different sizes
different colors
different shades
different shapes
so on and so forth
uh the Boca also shows you the lens
so here we can see some spherical aberration
or in other words the lens
because it is circular
is not going to be distorting the light 100% correctly
so how does that apply to our depth
the feel blur
or our Boca
well what happens is
either the inside of our Boca gets lighter
and then our edges have a bright ring around them
or the inside is brighter
now physically accurate
or in a perfect system
the inside would be bright and we would have
just a simple Gaussian fall off or just a blur
to the edge
but spherical aberration
often causes these kind of shapes
as well as the chromatic aberration
we can see along the edges of this Boca
now one last look at Boca
showing off some food photography
here we can see an even stronger sphere collaboration
you'll notice the shape in every single piece of Boca
is roughly the same
we have this center here that has a dark ring
uh surrounded by a brighter ring
and inside is a light circle
along with a rainbow
fall off at the bottom of the outer ring
now as you can imagine
this is a complex phenomena
that involves your entire lens
uh to create this effect
so let's jump into nuke
and take a look at one way we can do this
now we're not gonna be able to get as full
featured Boca as we've taken a look at
with our default tools without
an incredible amount of work
so let's take a look at what we can achieve quickly
and then we'll talk briefly about how we
can get that level of detail
so let's actually jump back to the top of our scene
uh remember this
uh no tree is acting as if we are going from the
outside of the lens in
down towards the sensor
which is our final viewer
depth of field is something that happens
outside of our lens
but is affected by our lens
so often placing it inside of our comps is difficult
however what we would like to have to create a
depth of field effect is a foreground
object and a background object separately
separately rendered so that we can have uh a nice
addition of
the foreground over the background
since we are going to be blurring various parts of both
so inside of our foreground
since we do have a 3D render
we have a Z depth pass
now if you wanna add depth of feel to a
real life piece of footage
it's gonna be a much more involved process
usually because there already is some depth to feel
blur available
and creating a depth pass from real footage is time
consuming to say the least
so here if we drop down our channels
we can see we have our Cam Z
now this looks like just a blank or a
full red channel
but if we dial back our viewer
we can see that there actually is data here
and this is just a simple
um depth pass from Maya
so to use this
we can add in a Z blur note
so I'm gonna hit tab and drop in Z blur
and plug this in between
our foreground and our foreground
uh over background merge
let's now take a look at this Z blur node
and let's jump back to our RGBA
of course we have uh
many lessons on this node
as it's a pretty useful node for creating this effect
for now let's just jump into our focal plane setup
and if we take a look at our Camz
we can decide what value we wanna start at
so looking at the red channel
looks like 19 is around where we wanna start focusing
so let's set our focal plane for nineteen
and then we can begin increasing our depth of field
now we do need to set the depth channel
normally nuke defaults to the depth Z
however ours is in a different place
it's in this Cam Z depth
so we'll drop it down to that
that will give us exactly what we're looking for
so here we set the focal plane
and now let's increase the depth of field
because we do not want most of this image to be blurred
so now let's take a look at our result by turning off
our focal plane setup
now this is gonna be a little bit difficult to see
so let's take a look at this
uh in our merge
and we can see a few problems
so the first problem is we have a Halo around our edge
and this is because it's trying to depth the fuel blur
around essentially nothing
so we're gonna need to either extend our
edge out or figure out how to fix this
but uh more worrying is that
our alpha channel is being degraded
and we have this strange Halo
around almost our entire object
and it looks almost like a light wrap
but I'd really like to figure out why this is happening
so let's take a look at the alpha channel
so if we go into our Z blur
and go into the alpha channel
we can see that our alpha falls off very quickly
and to really understand this
we're gonna have to look at our depth channel
so if we go to our Cam Z depth
and take a look
at the R channel
or hit a to get out of our alpha mode
we can see that the
depth of field is around
let's see here
15 to 20 uh
depending on where we are on the edge
now outside of this is zero
and remember
zero is close to the camera
so what's happening is
it is blurring out these pixels
because it thinks everything in front of it
is close to the camera
so therefore
it is blurring out our alpha by quite a lot
so there's a few different ways we can fix this
I'm just gonna go for an shortcut
by adding in the darkest color we have
into our uh
depth field
so that we no longer have that issue of such a big jump
between depth values
so let's go to our depth
and let's pull down our viewer
until we can see
where the darkest value is
inside of our depth pass
and it looks like it's one of these corners
so maybe around
I don't know 37 38
and so now let's take a
constant of that value
so I'm gonna hit tab
type in constant
and just put in a value of 38 oops 38
and now let's merge this with our current depth
so I'm gonna hit the m
key to drop in a merge node
and let me just give us
some room here
and I'll plug this into our constant
now we're gonna wanna merge our constant
with our depth pass
so we're gonna want to
output into our depth pass
so output into Cam Z
now this is just gonna overwrite everything
or it's gonna combine our RGB
and the constant we just created
but instead
in the B channel
I'd like to bring
in the uh Z
so let's go to
our B channels
and let's go to our other
layers Cam Z
so now if we pull this down
we're gonna see
that we have
the constant
in the background
but it's currently being
added to our
current depth of values
and instead
we wanna keep our
current values
and fill in
everywhere else with zero
so to do that
let's grab the
or let's change
the operation to under
which is gonna take the B
alpha channel
and since we
don't have anything
let's plug our
current camera
depth into that channel so again
other channels
Cam Z depth
what we should see
is our original
here and then everything
else is filled in
with this new
constant so again
this is kind of a workaround that
just fills in these
empty pixels with a different value
so now that our
background is
truly further away from
our camera than before
let's take a look
at the result
so if we go to our Z blur
jump back to our RGBA
and take a look
at our alpha channel
you can see that is much cleaner
so now if we go back to
our foreground
we can see these
edges have fixed themselves nicely
so currently
we do not have much of a depth blur
we're really only blurring one pixel
which isn't a lot
so let's pull this size up a bit
and we can see
as we increase this
we are now blurring
any object that is further away from the camera
now I don't want this to be at such a
extreme size
but I pushed it that far to show
you that we still have this issue
and this is because there's
currently a black
outline around
our foreground
if you take a look
we have a single pixel
of black outside
and we do not want that
so let's crop that out
and turn off black outside
so now our edge pixels are completely touching the edge
and if we look at our merge
they are now being blurred nicely
although the blur is still far too strong
so let's pull that back
uh let's maybe give this a nice
I don't know 4
6 uh choose whatever value you want for this shot
again the amount of depth blur is
directly tied to the aperture that you're shooting at
so if you're shooting very wide open
which is honestly unlikely in this bright area
you're gonna have a higher depth of field or
a larger depth size
otherwise you're gonna have a smaller depth size
now we also wanna
uh blur or add this to the background
so let's move our background up a little bit
and let's clone our Z blur node
so control excuse me
Alt K will clone that
and now we don't really have a depth channel
uh for our background
uh but just as we did with our constant we
can add in uh sort of another background
so our biggest value was 37
uh the sky or 38 and the sky is very far away
so let's give this a color value of 3 80
and this is just to make sure that our sky is always
as far away as possible
so I'm gonna hit the m key to merge this in again
and we'll plug the a pipe in
actually instead of a merge
uh we could use a shuffle copy note
we're not really merging anything
so I'm gonna hit tab and shuffle
our constant red value into our Cam Z
which is what that Z blur note is using
okay so let's see here
we want the red channel of our
input to go into the Cam Z
of our output
and now our Z blur is going to blur this
according to that depth
okay great so we've begun to set up our Zeebler
and as we can see here
we've got a little bit of a depth of field effect
now for us to really see the Boca
let's go to a later frame
when our camera has already moved
and we can see one of these highlights
and the shape it's creating
because as you can see here
we do not have a lot of Boca
alright so on one of these later frames
let's zoom in
and take a look at our Z blur
if we zoom in
let's actually increase
the size of this
just so we can see the Boca a little better
there we go
so this highlight is currently creating a
square shaped Boca
which I don't believe any lens has
only 4 aperture blades so that
um that is just
a very simple Gaussian blur shape
now if we want to have a circular Boca
inside of our Z blur node
we can increase the filter shape up to 1
and that's gonna give us this nice
circle however
that is really the
extent we can
affect the Boca shape
inside of our Zeebler note
again this note is not going to give us
the amount of control we need
to create that really fine
really detailed Boca
what this Z blur
note is allowing us to do is it is allowing us to do
a very simple depth of field blur effect
that we can use to
sort of defocus things
that we want
uh that are further away from the camera
as we can see here
so again the Zeebler note is not gonna be able to
get us that really nice Boca
there are quite a few plugins
for nuke the um
Lens Care plugin
the Gen Arts plugin
uh there's a few more that
escaping my
uh memory right now
but they all
are built to create that very expressive
uh very complex
Boca that we
want in our
very short shots however
unless you're really doing a macro
shot or something
that is supposed to be very small
uh you're really not gonna have as much Boca
as we saw in our earlier
photographs
the depth of field is gonna be
slightly smaller
and much more subtle
so that's how we can use
the Z Blur note as
as alongside
a Z Depth pass to
create a nice
depth of field
effect here
inside of nuke
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.