In this After Effects Fundamentals lesson, you'll learn all the basics of mattes. Like masks, mattes are a way to control the visibility of a layer. The big difference, is that mattes are a separate layer, whereas masks are part of the same layer. This opens up tons of creative possibilities.
Jump to topic on this page:
Find in video:
0:55
1:51
3:18
4:29
5:54
8:08
Preserve Underlying Transparency
9:05
11:13
First, you'll need to find the Track Matte options in the timeline. There are a few ways to make these options visible (depending on what you're currently seeing):
If you still don't see Track Matte at the top of the timeline, right click on that bar where it should be. From the pop-up menu go to Columns and then make sure Modes is checked:
There are two ways to create a matte:
After Effects will automatically turn off the visibility (eyeball icon) of the matte layer. For some types of mattes, you can turn this back on for a different look (example below).
Note: The pick whip for Track Mattes is new in After Effects 2023 (released October 2022). Also, in previous versions of After Effects, you could only use the layer directly above the affected layer as a matte. Starting in the 2023 version, any layer can be used as a matte, regardless of the layer order.
The difference between masks and mattes, is that masks are on the affected layer, whereas mattes are a separate layer. If you animate a layer with a mask, the mask will move with the layer. Mattes can be animated without moving the affected layer(s) and the layer(s) that are being matted can be moved without affecting the matte.
In this example, the position of the text (the matte) is animated, but the "design" composition is not affected. The "design" composition could also be animated without affecting the matte/text layer.
In the example above, if you wanted the "design" composition to move with the text (matte), you could parent it. This will make the it act more like a mask. In many cases, mattes can be more flexible than masks.
When you create a matte, by default it will be an alpha matte. Alpha mattes use the transparency values of the matte to determine what parts of the matted layer will be visible.
In other words, wherever the matte (the text in the example below) is 100% opacity, the matted layer (the "design" composition) will be visible, and wherever the matte is 0% opacity, the matted layer will not be visible. It's simpler than it may sound–where you see the matte, you see the matted layer.
Missed how to create a matte? Jump to back to that section here.
To see what's transparent in your composition, turn on the Transparency Grid by toggling the checkerboard icon, at the bottom of the composition panel, to blue. This simply shows a grid to indicate where there's transparency. So instead of the background color of your composition, you'll see this checkerboard pattern.
To switch, or invert, how the matte works, check the Invert box on the layer in the timeline. This makes any areas of the matte that are 100% opacity totally invisible on the matted layer and any areas that are 0% opacity totally visible. Here's an example:
Keep in mind that the color of the matte doesn't matter. After Effects is only looking at the alpha channel of the matte layer to figure out what should be masked. The "alpha channel" just means the transparency values (or in other words, opacity).
Luma Mattes work similarly to alpha mattes, but instead of using transparency, to determine what will be masked, they use luminance. You can think of luminace as brightness. The brightest areas on the matte will be visible (100% opacity) on the matted layer. The darkest areas on the matte will be invisible (0% opacity) on the matted layer.
For this example, I'm using an image of my bamboo desk as the luma matte for a text layer spelling out "Matte". Within the shape of the text, the dark areas in the image will be partially transparent when used as a luma matte. This will create a textured look using the light and dark areas of the image and the color of the text layer.
In After Effects, set the Track Matte of the text layer as the bamboo image layer. Then, click the icon to the right of the Track Matte dropdown menu to switch from the default alpha matte to a luma matte.
The result:
You could check the Invert box on the layer in the timeline to switch how the luma matte works. An inverted luma matte will have the brightest areas of the matte invisible on the matted layer and the darkest areas visible.
You can apply effects to mattes to manipulate how they look (or even add animation). When working with Luma Mattes, you may want to adjust the bright and dark areas of your matte. To do this, you can use a Curves or Levels effect.
In the example above (and below), I added a Curves effect and adjusted the graph in Effect Controls to make the bright and dark areas of the bamboo image (the matte) more dramatic.
Just to the left of the Track Matte options on a layer in the timeline, is the Preserve underlying Transparency button.
Turning this button 'on' for a layer means that this layer will use the combined transparency of all the layers below it as a matte. It works like an alpha matte so wherever the layer/s below have 100% opacity, this layer will be totally visible and wherever the layer/s below have 0% opacity, this layer will not be visible.
In this example, turning on Preserve Underlying Transparency for multiple layers can has a similar effect to using the same alpha matte for multiple layers (see example above):
Let's look at how Preserve Underlying Transparency is different than assigning the same alpha matte to multiple layers. If we add a layer to the bottom of the timeline, it's like adding to the matte.
Layers can be mattes for each other (this is only possible in After Effects 2023 release and later). In this example two circles are alpha mattes for each other:
Now check out what it looks like if we invert the alpha matte:
Now that you know the basics of mattes, you can get creative with using different types of mattes on different types of layers, and combining mattes, masks, and effects together.
In the next lesson, you'll learn how to export (render) your animation as a video file that can be played outside of After Effects.