a matte is used to hide part of one layer in after effects using another layer they are essential for
working with texture reveals and compositing and understanding exactly how they work will open up
a world of possibilities for your animation and filmmaking so to start we need two layers one
is our base footage layer that we want to hide a part of and the second layer is the actual
matte so to use it as a track matte our matte layer has to be directly on top of our footage
in the layer stack then we need to select the bottom layer and from the track matte column we
need to select how we want to use this track mat now if you don't see this column in your
timeline you can toggle it on and off down here with this icon in the bottom left so there are
two types of track maps that we can use alpha mattes and luma mats first let's select alpha
matte and see what happens we get our footage cut out in the shape of our head and in our layer
stack we can see that our matte layer visibility has been turned off automatically so we are no
longer seeing a matte we're seeing its shape and everything else has erased the footage underneath
and we can do anything to animate this layer independently let's quickly animate its position
its scale and rotation so now our map is animated but our footage is staying still if we want our
footage to stick to the map we need to select our footage layer and then in the parent and link area
select the pick whip click drag and release over our matte layer now when we play it its scale
position and rotation all move along with our matte now this track matte is called alpha matte
because it is using the alpha channel of our image to determine what areas to cut out and the alpha
channel is essentially what part of this layer is transparent so our head is a square png i cut
everything that's not his head out in photoshop so the pixels on the outside are transparent after
effects sees that and only cuts out the visible pixels on our layer below we can also choose alpha
inverted matte which essentially just inverts the alpha channel and flips what is visible
and what is not if you use this same principle on some text as an alpha matte over some footage
you can get this effect to transition from some text to your scene like they do at the beginning
of stranger things now let's see what happens when we use a luma matte this is a little more
interesting some parts of the head are removed from the layer underneath but not all of it now
after effects isn't looking at the alpha channel the transparency of the matte it is looking at the
luma channel the luminosity values of this layer which is its brightness how light or dark it is
so the dark areas of this image which will be the hair and the shadows those are cut out of our
footage so only the bright areas of our mat remain in our footage below and we can make adjustments
to this we can add an effect like curves to our matte layer and make it lighter or darker to
change how much of our image below is revealed and if we use luma matte inverted that flips it again
so now it's removing the bright areas of our mat from our footage if you find some footage of some
bleeding ink make it a track mat of your footage and set to luma matte inverted and now you've got
a nice ink reveal now the main disadvantage of using a track mat is that you can only use one
mat so if we wanted to cut out more than one shape from this layer we would need to either pre-comp
these layers and then use another alpha matte on that pre-comp or pre-comp both of our matte layers
and use that combination matte pre-comp as a track mat which either way isn't a very elegant solution
but know that it's there and sometimes to get the effect you want you'll have to brute force it by
pre-copying some elements in many cases though the most elegant solution is to use the effect
setmat now to explain the setback effect we're going to start in a fresh comp again with our
rainforest footage but we're going to drag in a new map to try and this time we're going to select
our footage and from the effects and presets panel we're going to add the effect setmat and
up here in the effects control panel we have many many lovely options we can choose which layer we
want to take as a matte we can choose whether we want to take the source of that layer or its masks
effects and masks and we can choose whether to use the alpha channel the luminous channel and a bunch
of other channels as well and options to invert it as well so let's choose our matte leblanc
layer and we can see that's not doing quite what we'd expect it stretched out our matte layer and
this can happen a lot with the set matte effect this is the main disadvantage of using it in this
case we can simply uncheck the stretch matte to fit option and now it's working like we'd expect
but our matte layer is still visible so let's hide that and now we can see the effect we want
and that is one of the benefits of the set matte effect our matte layer doesn't need to be on top
of our footage layer we can drag that underneath turn it back on and still use this layer for all
sorts of things we can even invert matte in the set matte effect and use the matte created to
reveal the matte itself how are you doing and one thing you should definitely be aware of when using
the set matte effect is how to deal with another common error you're likely to encounter and that's
when using a map that has been pre-comp'd so let's delete our matte layer here and drag in
a composition which contains a few images let's go back to the set matte effect on our rainforest
change that to the new precomp and you'll notice wherever i move the matte composition the matte on
our footage isn't following so what we need to do in this circumstance is collapse transformations
and you can do that by selecting it down here in the timeline and then of course we'll need to
hide our matte comp and now we can move our matte layer and it cuts out like we'd expect so if your
set matte effect isn't working like you'd expect double check to make sure stretch matte to fit
is not selected and then if using a comp or a layer that can be collapsed make sure that
is selected for both layers the matte and your footage layer to learn more really cool techniques
with mats using textures check out this next video where i make this animation i'll see you there