Afrikaans
Akan
Albanian
Amharic
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
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
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
hello and welcome back to nuke 2 3 1
nuke compositing best practices
this is Victor Perez
and in this 5th class
we are going to finish
the subject of optimization of the workflow
and remember that all the files for this class
and the previews the No. 4
are already contained in the class files
for class No. 3
so another thing that we have to discuss
is the issue of the boundary box
because it's something Misty
that I understand for many people
how the boundary box needs to be handle
okay so I'm using to start
this shape okay
is a star that is partially inside the format
and partially outside the format okay
so when you are working with the Roto
note the Roto has the ability to clip the boundary box
that by the way
the boundary box is nothing more and nothing less
than the active area of an image
so when you are applying a process to that image
is not going to be apply across the format
but across the boundary box
so all pixels inside this line okay
are going to be processed
and the boundary box
is defined by two sets of coordinates
the first one
which is the lower left corner
and then the second
which is the upper right corner
so in this diagonal
is just telling me
what's the area of action that is going to be apply
okay so that's the boundary box
but 50 notes like
the rotor is affecting how the boundary box is behaving
for instance
I'm going to apply here square
so I'm applying this shape okay
and see that my boundary box is now expanding
inside the format but
I'm clipping the boundary box to the format in here
which means in my previous image
the boundary box was even outside the format in here
as soon as I clip to the format
everything that is going to be
created by a spline in here
is going to be limit to the inside area of my format
the format is representing the pictures
that are going to be display in the final image okay
so I just clip
see the difference in here
I apply also a circle
see that the circle is supposed to be outside
but see that
the boundary box is not getting outside the format
which means that is nothing outside
so if I transform that
see that the boundary box is travelling
with the transform okay
but all areas that wear outside the formats
are now crop
okay because I was clipping my boundary box
if I deactivate those rotor nodes
see that my star that was clipped by the roto
is now reappearing as a whole
okay so what is happening here is the clip to format
is just cropping the image outside the format
and they are five options in here
which is no clip
boundary box
the format the one that we just review
and then we have the union
of the boundary box and the format
or the intersection between the boundary box
and the format
okay we are going to analyze all of them in here
so the first option is the clip to format
okay and it's not grown
it's just you need to know if you are going to need
that extra space
that you are having your image or not in here
if I was going to transform probably
I want to get everything from my original image
and even from the elements I'm placing okay
because everything from this note is going to be clip
okay so this is the first option
then we have the second option
which is this note is clipping to the format
but this one is not
because I just plays the no clip
so what's happening here well
see that we have to analyze the pipe from the region
so in here I have my boundary box
that's related to the whole image of my star
but then in this is having the clipped format
so exactly as before
so I'm getting my square in here
which is inside the format
but outside the star is just gone okay
but in the second row to note
I just say that I have no clip
so when I'm applying this circle
my circle is getting even outside the format
if I transform that
you will notice that the difference between this
and this is that the circle
is complete
okay I'm not clipping anything
but there is also another thing
have a look at my star
oh what's going on in here well
what is going on is a particular feature of nuke
that is the extension of the last pixel
of the boundary box
this is something quite common
and actually
every time we are using a transform
that issue is being addressed by this black outside
because nuke
every time you are getting an image touching that
boundary box
or by default
the format is going to extend automatically
the last pixel that is touching the boundary box
or the format to the infinite
but is not being processed
is just a way of displaying the image
so if I do this
and I clip with this boundary box
this image and then I move
what I'm actually displaying here is my boundary box
was clipping this part
and now everything is getting extended up to the end
and see that right now
the last pixel that is touching the boundary box
is actually black
so now it's extending black
of course extending black is like
having nothing beyond the boundary box
but is not having nothing
is actually
in the correct way of analyzing the image
is extending
constant black value
so zero value
if we go to another example
what I have is that
the square is having the intersection between
the boundary box and the format
so here have a look
what is going on
see the boundary box
the last pixel in there
is this one
so is touching the boundary box
so then it's extending that pixel horizontally
to the infinite
and then the same in here
so it's not like the square is bigger or is broken
is just totally normal okay
but we're going to see this operation in a bit
let's continue with this
because as I mention
what I'm doing is extending this black pixel
but who is in charge of deciding
why I'm putting in here this black pixel
where by default
the transform
is just preventing you to have that extension
that is quite ugly
when you are transforming an image
so he's adding a black pixel
in the last pixel of your shape
so if I remove that
see that now the boundary box is just shrinking
well it's not shrinking
is that in the black outside option
is extending by one black pixel okay
so this is the natural image without the black outside
so everything that is touching
the edge of the boundary box is getting extended
so in order to prevent that
by the fault they transform
is getting this black outside
so why is this extension appearing then
well is because when we are cutting my boundary box off
beyond the format
with the first operation
this is now touching my boundary box
and in here
with this circle
I'm extending the boundary box
because in here
I'm not clipping in the second note
and not clipping the shape of the circle
so what is happening in here
is extending this last pixel from here to there
and now this is the final boundary box
so that's why
when you are moving
you are getting this piece
that is representing that area
that is from the edge of the format
to the edge of the boundary box okay
so what if I don't want to have that
what if I want that to be completely crop
without extension
well you have to use
now in here
a note that is black outside
if you place the black outside in here
what you are going to do is just to prevent
after this result
to have my last pixel to touch the edge
in this case
of the format
so by adding the black outside
what I'm doing is just adding a pixel
to the boundary box in all directions
so is to the right
to the left
up and down okay
so is extending that boundary box with a black value
so now when you are applying the circle
and then you are moving
the circle is complete
the star is clipped
but you are not getting the extension of the pixels
okay so that's why you need the black outside
so every time
you are getting funky results of extensions
from the lax pixel touching the boundary box originally
this is the note that is going to help you
okay so I'm going to leave it in here for you to study
then we have the best case scenario
when you don't want to lose a pixel
of your original image
this is recommended
when you are using tracking operations
or any transformation
that is going to use pixels from outside the format
okay so in here
what you need to use
is the option no clip
that is the same option I was using for the sequel
so that is just going to add information
but never touch the original information
that you already have in your input image
okay so in here
I'm adding the same thing
so if I transform
I have everything together
okay and nothing lost
and see that the boundary box is traveling
every time I'm moving the transformation
and more than that
every time you are using a note
that is processing the image
and is expanding that process
like for instance the blur
if I'm blurring now this image
see that the boundary box
is getting bigger and bigger okay
but in here
is being crop
at the format why
well it's because
I'm saying in here
that I want to crop to the format
but not the input
just the effect
okay so if I use the blur
is going to preserve my original boundary box
but is not going to expand the boundary box
of the effect
beyond the format
if you don't
want to crop to the format
you just deselect that
and then everything is going to expand
to all pixels needed to
to the operations
now in here
we have the B box
b box is just going to add the information you want
but is not going to modify
the original boundary box of your image
so if your image is inside the boundary box
is all good
if your image
that you are generating
the mat or the shape
is touching the wondering box
as I mentioned before
is going to expand
okay so if I apply now
the transform
look what's happening
he's now removing that
extension effect
why is because
the boundary box is actually the same as before
so I'm just adding the black outside
to this original boundary box
and then if I use the boundary box crop A9
placing an element
outside the boundary box
that element is not going to be display
so is not in the
available area
to be represented
okay so that is the boundary box
so you have to pay attention
when you are using that
then you have
the intersection
between the boundary box
and the format
and this is the most restrictive way
of working with the boundary box
which means
whatever you place in here
in this rotor
needs to be
inside the format
and inside the
boundary box
of my previous
and everything that is getting outside the format
and outside
the boundary box
is not going to be
represented
okay so he's cropping
my boundary box
and he's not extending
the boundary box
so that is the intersection the same
if I apply the circle in here
outside the boundary box
nothing happens okay
same issue
of the black outside from the B box
but in this case
we don't have the outside area of the format
then we have the intersection
so they're saying as before and then they clip to known
and this is a curious case
because in here I was expanding my pixels up to the end
and now I'm deciding to place a certain element
so if I transforming here
or simply I apply a black outside
the blue extension of my rectangle is being preserved
because in here
this circle
is just expanding that boundary box with that extension
okay so this is the original image
this is now my circle
this is now my image with the black outside okay
so this is something to be careful okay
so I leave that
and then for the last one
I'm going to get the B box and the format
just to get the outside area of this square
so if I move
in here see that the square is actually a bit bigger
but not much is just up to the area of my star
so it's not expanding more than the pixels
that are inside the boundary box of the original
but it's expanding within the limits of the format
so that's why everything
like the circle or the square in there
is being expand normally
okay so that is the transform
then I prepare for you
a few examples of optimization of the boundary box
so in here I just apply an scale operation
so if you are sure that you don't need
those pixels anymore
you can just crop them
so by applying a crop
you are just deleting all the pixels
that are outside the limits of the crop
that by default
if you select a crop while uh
the last note of your composition
where you want to apply the crop
is selected
the crop is automatically setting the limit
to the format of that image
so in here I'm optimizing my image
by removing any unuseful data that I have
then in here
you have this boundary box
and then you can apply the same principle
but you discovered that is not that good
so if my boundary box is getting outside
but it's smaller than the format
if you apply a crop to that image
yeah you get everything outside the boundary box gone
but you are getting also
the boundary box that was smaller here
is now expanding to the limits of the format
so for this particular example
where the boundary box is not bigger than the format
in all sides
is not a good idea
just to crop that tiny effect
so how can I apply that well
let me give you a work around
and for that
I'm going to apply a roto note
and this roto note is going to be applied to modify
the boundary box of the image
not to create any shape
so what I'm doing is
I'm going to use the intersect B box and format
and I'm going to place any shape of my choice in there
okay um why is
because if you don't place any shape
the rotor is not going to apply
any process to the image
so you can just do any shape outside I can hear
and as soon as you place it
is going to apply the process of the boundary box
of course because I'm outside the format
and the original boundary box
this shape is just doing nothing
but even more
if you want to apply that square and
you are not sure where this boundary box is traveling
you can just place it in here
there's nothing wrong with that
of course if you place it
and then this boundary box is moving in there
or by chance
you get in that
what is happening is
you are going to render something
but if you put the output at no
whatever is the shape you are placing here
is going to be irrelevant
because you are not outputting any data from this note
so is just taking in consideration
the boundary box work
okay so when you are cropping an area
that is smaller than the format
probably is going to be better
yes to use the roto
and of course
you can use the roto also for the other one okay
then when you are handling the boundary box
sometimes is going to be helpful
just understand how the merge
is going to handle your boundary box
because if you have a big image
with a big boundary box
and then a smaller image
then by the fault
the merch is not going to discard any information
and that's good
but sometimes
we don't need that information
that is outside the bone
that is of my format
so for that purpose
is going to be a good option
yes to select
what's the right size of the boundary box
let me tell you that
most of the times
when you don't want the
boundary box to be beyond the edge
of the format
you want to use the P
if you are using the methodology I am giving you
for the composition
where the B input is always the main input
when you are using the B
here in the set boundary box B
the B is usually representing
the live action plate
and of course
the live action
or the background
is the base
for my image
I'm not going to remove that
so what I want is
just to preserve that format
so when you want to
keep the original format
and you are working with the be input
as the main input
what you want
is just to put in here
that you want to set
the boundary box
to the being put
so the original main image
okay of course
there are other options
like the intersection
where is just going to get
whatever is
between the format
and the boundary box
I already have
in my images
so is just the smaller
option possible
and then the a input
which is just preserving
every aspect
of the a image
except exchange
occasions where
your operation is not reversible
and you want
the particular
format to be
in the a input
you are not going to use the a
options much
and then the intersection
of course is going to generate
most of the times
this issue of the edge
so is probably going to be
accompanied by
the black outside
okay um the
most common
are the default union
or if you want to get
your boundary box optimized
instead of using any cropping option
you just leave that
to the merch
operation okay
then another thing that we can analyze is the outcrop
what's an outcrop
well outcrop is something that is going to be apply
just to reduce the active area of an image
to the area of interest
so if you are getting this image
where everything is black outside the alphabet
everything is being used
if you want to reduce the process of calculations
what you are going to do is just to apply a curve tool
to out of crop that area
so how is the out of crop working
well you are telling in here in the curve type
okay that you want to apply a now to prop
and by the way
the curve tool is in the first menu here okay
and then you are telling the outer crop
what's the base colour to look at to be crop
so if you put zero
he's just going to look for the zero value
and everything
that is going to be a block of zero value
that is useless outside a square
defining what is a possible boundary box of this image
something that could be something like that
for instance okay
something like that area um
is going to be like
taking out of consideration those values
then there is an intensity range
this is in case you are having values above or below
and you want to say
I want a threshold of 1
this amount
just to get everything that is from 0 to 0.1
and minus 0.1
is going to be take in the calculations to be removed
okay so in here
this is not actually that good
because you are actually deleting certain information
but in case you are sure of what you are doing
or in case you are getting artifacts for compression
or other kind of grain
maybe this is going to help
but remember
you are actually deleting information of your image
the outer crop is working great with CG
um why in this case
I'm not getting
the area of interest in the boundary box
is because even if in this image
is looking like
this is black outside
the area of the monster is not like that
because there are other channels in here
like for instance death
that is having values
so when you're working with the outer crop
the outer crop is going to look up
every single value of every single layer set so
is making sure that you are not losing any information
so like in this instance
if you want to apply the outer crop
you need to be sure that all the images
that you are going to crop
and it can crop in animation
that that's the nice thing
everything is going to be
with a value of your choice in here usually 0
and that is going to crop the image
even if the image is going to be in movement
so for that
I'm going to select the
out of crop
0 and 0 yes
don't look at the others
except the region of interest
that you need to be sure
that is matching the format of your image
just to be sure you're not losing any information
and then you press go
it's going to ask you for the frame range
you want to calculate
that auto crop
it's going to be right
the whole theme
so I'm going to
pressing here
is going to take a
few seconds
is not that slow
to be honest
and now is giving me certain information
that by the fall
is not display
but is in there
you just need to go to this outcrop data
and is telling you that
in each frame
that's the area that the crop should be applying
but right now this is not applying anything
this is just telling you where the crop should be
applying for every frame
so you need to create
now I'm going to copy in here the animation
and now I'm going to create a crop
and in this area I'm going to paste the information
so now if I close that
see that the boundary box is matching perfectly
the shape of the monster okay
but what if I apply this to the other option in here
even if he's looking right
and actually removing information that is useful
so if I go now to the layer contact sheet
see that now the ambient occlusion is being crop
the death is being crop
and this is being crop
so the boundary box is not
storing the information just for the rgba
this is storing the information for
any channel contain in this stream of images
okay so in this file
for instance
is having information beyond the
zero value of the alpha okay
so that's why it's not right to apply that in there
so I'm going to leave in here
and I'm going to deactivate then
the last case scenario for today
is the handling of the boundary box
when we are working with a 3D setup
in terms of camera reaction
so there are four main areas to look
when we are working with the boundary box
which is the geometry
the scanline render
the lens distortion
and the final merch
okay so where some looking here
the result so
what I'm doing is I'm applying a patch over here okay
and let's have a look at the area of the boundary box
by default is giving me this area
which is not that great
um why is that big
well the area that I'm applying for the projection
is this one
okay but this one is actually just the patch
even if I crop this
doing this
is this going to change my results
absolutely not
because it's not depending on the pixels
see the crop is irrelevant in here
the projection is actually looking at all pixels
of the geometry
so when you are applying a projection
you just need to be careful
that the surface of the projection
is enough to cover the patch
but not so big that is adding a ridiculous amount
of boundary box bleeding
so what you can do is just trimming your geometry
be careful not be so close to the edge
because probably in the representation of the 3D
that is not perfect
render is just a proxy
render for you to visualizing the viewer
is not giving you probably the anti alias options okay
so just leave a
reasonable amount of geometry for the projection
okay so now with this
I'm getting way less okay
other things to look at is
the scanline render why
let me show you the frame of the prediction
which is 153
something happens that 13 elements of the render
after the scanline render
are so close to the view port of the camera
that is actually touching the edge of the frame
I'm going to place in here a cone
trucking Kong
I'm going to convert it into a group so you can open it
and I'm going to place it in here
I'm going to put an axis
so I can move it
and I'm going to put it in here for instance okay
and in here
okay nice I got my comb represented but now
if I go to this calendar is looking perfect
but after this calendar
there is an operation
that is taking pixels from the outside
and taking inside
is exactly what is happening
when I'm calculating my camera
okay so I'm applying the men's distortion
so my pixels are getting stretch on the corners
just to represent the same amount of distortion okay
so through this process of camera projection
that bleeding
so the area that is outside the format is gone
he's not there anymore
so when I'm applying the lenses
torsion the lenses
torsion note
he's expecting me to have those pixels outside
just to put them inside again
he's like putting those notes together in here
see this is getting my pixel outside
then my pixels inside
then everything is is nice
but if I apply a crop
just by removing those pixels
see what's going on
everything that was supposed to be from here in outside
the image is gone
so I'm actually
needing more information from this scanline render
and to correct that
you need to go here
in the scanline render to the overscan
okay in the overscan
what you are doing is actually rendering the pictures
that are beyond the format
so something like that okay
there is no mathematical way of calculating
how many pixels do you need to have in that operation
so is something to do by I okay
be generous okay
and the best way to search for the information
is at the corners
because in the corners is where you are going to have
more deformation of course
so you go to the corners
and then you have to add enough overscan
just to get the lens distortion to work
without any kind of artifacts
um be careful with this
because if you put a very
very high overscan
that is going to crash the memory of your computer
because of course
you are going to render a huge image
so be careful when you are working with
or scanning okay
just enough
and then when you apply the lens distortion
you will see that there is always a space remaining
of boundary box
that in this case
is going to be useless
so what I recommend is
as I mentioned earlier
is to go to the merch
and then instead of using the default union
you're going to use the B input so in here
everything is crop
outside the area that is not interesting anymore
okay so in here everything is combined together
so working with the boundary box is very important
because it's going to optimise your render time
if you start
losing the track of where your boundary box is
at the very beginning of the script
probably by the end
you are going to have a ridiculous amount of processing
that is useless
so it's going to kill your render times
so pay attention to the boundary box
because it's going to help you um
when things are in a rush
um at the end of the day
they are all in a rush
he's going to help a lot
so that's all for this week
if you have any comments
questions or suggestions
feel free to post them in the forums
as always this has been Victor Perez for FX PhD
thanks for watching
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.