Order of Operations

Before we apply the filters, let's talk about "order of operations". This is the order in which things get processed in the Motion rendering engine. The graph on the left indicates that order.

An image starts at its original size, not yet scaled, moved or rotated. The image then has any existing filters applied to it, such as a blur or glow. It is then masked (if there are masks) and then transformed (scaled, rotated, etc).

This means that if you have an SD-rez image (720x486) and you scale it waaay down to 10% (72x49) and then apply a blur to it, Motion is actually applying the blur to the SD-rez original size and then scaling the result down to 10%. It also means that if you mask an image and then blur it, the image will be blurred first and masked afterwards.

But what if you want to apply a filter to an already masked image? By nesting or pre-comping: put the masked image inside a layer and apply the filter to that layer. All processing is done from the lowest level upwards, so the masked image gets processed and becomes the starting image for the layer, which then gets filtered. Let's look at a quick example:

Fig. a shows a checkerboard image. In Fig. b we see the image after it has been masked. If we apply a Gaussian Blur to the masked image, we would get Fig. c as the result, because the filter gets processed before the mask. If we drop the masked image into a layer and apply the same blur to the layer, we get Fig. d, the desired result. Through nesting/pre-comping, we can force Motion to do things in the order that we want.

How does all this relate to our reflection project? The basis for the reflection is the Mirror filter, but instead of applying it directly to the masked fire footage, we'll nest the fire in a layer and apply the filter to it. We will also enable Fixed Resolution for the layer, because the fire footage extends unnecessarily outside of our project area and we don't want the layer to shrink-to-fit (the default). Luckily for us, Motion starts all projects inside a new layer, so we'll just use that one.

Adjust and filter the layer

  1. In the Layers List, double-click on the name of the parent layer and rename it to 'Magic Mirror'.
  2. With the 'Magic Mirror' layer selected, go to the Inspector and view the 'Layer' tab.
  3. Enable the 'Fixed Resolution' checkbox.
  4. With the 'Magic Mirror' layer selected, go to the toolbar and select Add Filter->Distortion->Mirror.
  5. In the Inspector, view the 'Filters' tab and set the Mirror Angle to 90°.

As you can see, there is a teeny gap between the original and the reflection. We'll fix that by nudging the 'fire' text down a couple of pixels.

Nudge the text

  1. In the Layers List, select the 'fire' text object (leave it disabled).
  2. Hold down the Cmd key and press the down arrow until the gap closes.

Note how you were able to make changes to your mask reference and see them reflected in the result. Our next step will be to add some blur to our reflection. For a little added realism, we'll use a blur that increases with the distance of the reflection. Again, we will apply the filter to the parent layer, not the masked footage.

Add the blur

  1. In the Layers List, select the "Magic Mirror" layer.
  2. From the toolbar, select Add Filter->Blur->Gradient Blur.

The Gradient Blur filter has two points on it: the blur starts from the first and increases until it gets to the second. We'll have the blur start at the beginning of the reflection and end slightly after, as shown in the movie below:

We have a mirror effect and a blur, but we still need our reflection to fade out with distance, which we can do with another Image Mask.

<- Page 1: Getting Started
Page 3: One More Mask ->