Published on December 2, 2023
We’re nearly at the endgame now. Ah, that sounds so cliche. But seriously though, this is the second last blog post pertaining to the suggestions of Aaron Schurman. Here we discuss Track Mattes, said to be one of the most awesome features in After Effects. Track mattes let you animate both the mask and the content underneath. This helps to develop cool animations and eye-catching effects.
Everything was not always cool with track mattes, though. In the beginning, Bodymovin and Lottie didn’t really get along with track mattes. They didn’t support it and as a consequence, there were a lot of performance issues. These hindrances were particularly more apparent on Android. Gradually, by time, track mattes have seen improvement. The evolution of these platforms let them support alpha mattes and inverted alpha mattes.
Although this was a significant improvement from their previous condition, there were still certain caveats. As it happens, every asset is required to be rasterized during the process of playback rendering. Taking this into account, the track mattes will be built as raster assets by Lottie in order to combine them back into the composition and this implementation comes at a cost. There is a possibility of having your performance downgraded.
There will be a lower impact on performance if a layer mask is used instead of a track matte. This is because animating the points of a mask costs less compared to Lottie rendering an entire layer. Nevertheless, using a track matte works in most cases. It’s just you need to be more aware of its limitations to help you orchestrate a smooth performance. Let’s take a look at these setbacks in the following segments.
Utilizing Track Mattes in Animation
Explore the concept of Track Mattes in animation and their application, while uncovering the inherent limitations they present in complex compositions. Discover ways to navigate these constraints for smoother and more efficient animation workflows.
The Caveats of Track Mattes
The size of the composition doesn’t directly affect the final outcome with track mattes. These elements are adjusted to fit different screens before they’re used, but this scaling process demands significant processing power, especially on devices like iPads or older phones with varying resolutions. Challenges arise at the edges and intersections of these mattes, especially when rendering larger ones covering more of the composition. Using multiple smaller track mattes, about 2 or 3, tends to perform better than one large matte, though this varies based on asset complexity.
For highly complex assets, employing a bitmap as a track matte can provide a performance boost. However, if the matte is simpler, using a shape layer might deliver faster performance compared to a bitmap. Choosing between larger or smaller mattes and deciding on bitmap or shape layers can significantly impact overall performance, especially on devices with different capabilities.
The Complexity of Intersections Between The Track Mattes And Other Assets
Another performance issue to be aware of is the complexity of intersections between the track mattes and other assets. You will find that if you use a track matte on a very complicated precomp with numerous layers it’s going to be much more of a performance hit when processing and applying the matte during playback. Also, if you apply track mattes to precomps containing track mattes you are multiplying the processing needed because Lottie may have to render both mattes at the same time. One way to avoid performance issues in these situations is to be wary of how much you are animating the track mattes themselves. The more a track matte changes from frame to frame, the more chances there are it will need to be reprocessed and re-rendered.
Using a complex track matte on a precomp with numerous layers can slow down playback as the system processes and applies the matte. Additionally, applying track mattes to precomps already packed with track mattes intensifies processing demands. Lottie, in such cases, has to handle the rendering of multiple mattes simultaneously, significantly increasing workload and time consumption.
The Impediment of Inverted Mattes
When streamlining workflows that involve track mattes, it’s crucial to consider inverted mattes as well. In the optimization journey focused on track mattes, remember that using inverted mattes adds an extra step: color inversion during Lottie’s rendering process for implementing masks in playback. While this step doesn’t significantly impact performance, it’s prudent to account for it during animation development. Though the performance impact is minimal, being mindful of it contributes to ensuring a smoother workflow for your animation projects.
Cleaning The Mess
To conclude, we’re going to look into some last-minute cleanup. Literally, though, we’re talking about cleaning the mess here. When using track mattes, file cleanup should definitely be taken into account. Especially when fill modes are accidentally used on a track matte layer.
Take this scenario for example. Say, when you are animating, you may have a layer with a ‘Gradient Fill’. Then you duplicate this to create a track matte layer. But then, the necessary action of deleting the ‘Gradient Fill’ completely slips your mind. Nevertheless, this layer would still be processed as if it was visible in spite of just the alpha data of that particular layer being put to use. Once again, this may appear trivial but over time, this can get clogged up if neglected.
Track Mattes is very beneficial and understanding its limitations will give you an edge to construct a smooth interactive experience. Hopefully, this article will come in handy in this regard. In our next blog post, we’ll be discussing the last suggestions Mr. Schurman has to offer. We’ll be discussing in detail the issues involving merge paths and how to resolve them.