For years, software-based compositing apps have dominated the market, from the high-end visual effects studio to the lone-gunman motion graphics artist at home. Shake, Media Illusion, Eddie, Flame, After Effects, Combustion, Commotion and so on. Occasionally, some of them have dabbled in OpenGL, but they've stayed mostly in the software-based realm.

With the release of Motion, Apple jumped squarely into the domain of hardware-rendering. Every pixel of every image you see in Motion passes through the GPU. Every blend mode, every filter, every compositing operation is performed in hardware, on the graphics card, on the fly. And within certain limits, these operations can be performed very, very quickly, thanks to the dedicated processing capabilities of the GPU.

Being a good friend to your GPU

Having a GPU-based renderer is like having a tricked-out car engine: it runs best with some tweaking and preparation. Put the wrong stuff in, or ask it for too much, and it locks up and dies on you. Understanding when, where, how and why things happen in the rendering pipeline will allow you to work more quickly, solve more problems and build projects that run faster. Faster playback means better feedback as you experiment, which means more experimentation, which means more creative results.

See where I'm going with this?

So what are those certain limits? Well, they depend on the particular GPU you have. There are a number of different factors that affect the performance of a given graphics card: interface speed, memory, memory bandwidth, fill rates, shading pipelines, RAMDAC speeds, etc. Some of these attributes have more effect on game performance, while others pertain more to how your graphics card handles Motion's needs. Putting aside all those various specs, let's focus on something simple: resolution.

Resolution, schmesolution


fig. a

Graphics cards have a limit on the largest texture (image) that they can draw or process. This is a non-negotiable number: the card is physically incapable of handling/processing a larger image.

Every graphics card out there that is capable of running Motion can draw at least 2K (2048x2048) textures. At the time of this writing, all available ATI cards (except the X1900) are limited to 2K. Some NVIDIA cards, such as the 6xxx series and newer, are capable of drawing 4K (4096x4096) textures. If you look at fig. a, you'll see a comparison of DV, HD, 2K and 4K resolutions.

Looking at this, 2K might seem like way more than enough space for DV-rez work, and 4K ridiculously so. But you can hit the 2K limit quite easily, even when working on DV- or SD-resolution projects.

When you add an image to a project, Motion loads the image from disk to system memory (RAM). When Motion goes to display or process that image, it sends the image from RAM to the GPU, so that image goes onto the card at the image's full size. If the image is bigger than the card's max texture size, Motion scales the image down to that max size. So a 7-megapixel image (3072x2304) gets scaled to 2048x1536, making it acceptable for use.

This means that if you take a measly 3-megapixel (2048x1536) digital camera picture and add it your project, your image is already at the 2K limit. If you apply a single filter that causes the image to grow, like a blur or glow, the image will exceed the texture limit.

So what happens when you've hit that limit? Well, the first thing you see is the trusty (and annoying) warning dialog which tells you that you've gone too far.

The blurred image will now be cropped. And not necessarily center-cropped either, so your image may shift up, down, left or right.

Order of operations

Maybe you're saying, "Ah, but my project is only DV, I'm scaling that 3-megapixel picture waaay down, so it's nowhere near 2K in size when I apply the blur to it!"

But there's the rub: all filtering is done before transformations. If you apply a blur, or a brightness, or any other filter, it gets applied to the full-size image and then the image gets transformed.

Back to our 3-megapixel picture example. If I take that image, which is already at the 2K limit, scale it down to 10% of its original size, and then apply a Gaussian Blur, here is what I'd see:

Note the cropping on the sides of the image, as well as the pixel smearing that starts in the bottom-third and continues to the bottom.

But, if I were to pre-comp the image by applying the filter to the image's parent layer, I would get a better result:

By applying the filter to the parent layer, we've taken advantage of the compositing order of operations. The image gets transformed (scale), then the parent layer gets the filter applied, and since the parent layer is the same size as its child, a much smaller area is being processed. Not only does that give us the desired result, but it's also faster.

But let's say that you have a GPU capable of 4K textures (sounds of author grunting as he switches graphics cards, muttering about dropped screws). With a 4K limit, you've got a lot further to run before banging into the wall. It could more than handle that little 3-megapixel image, right? You certainly wouldn't have the cropping problem, but what about performance? Since the filter gets applied to the full-size image, before transformations, using media that is overly-large is grossly inefficient. Let's go through an example:

I have an SD (720x486) project. I'm putting an image into the background, and I'm going to blur it. The image won't be moving, won't be changing size, it's just a background. My image is a 2K still from a digital camera (3-megapixel or higher), so I bring it into Motion, scale it to the project size (720x480) and slap a Gaussian Blur filter on it, with the Amount set to 64. Since the max texture size on my new GPU is 4K, no cropping is taking place. I like how it looks, but how fast does it play back? If I hit play, I'm getting a frame-rate of 15fps.

15fps, on the best available* GPU, playing back a still image! And that's without adding any video, text, particles or other embellishments, all of which will slow things down further. Where's the sense in filtering this huge image, when I have it scaled down, anyway? What if I were to pre-comp the image into a layer, and adjust the blur so that the results look the same. How fast would my project play back, then?

60fps. Almost four times faster than the speed of blurring the full 2K image, just by pre-comping. The first reason for the dramatic improvement, we already know: a smaller image takes less time to process.

The second reason is a little less obvious: some filters, like Gaussian Blur, are based on pixel values, so a 2K image with a blur of 64 is much less blurry than a 720x480 image with a blur of the same value (fig. b).


fig. bfig. c

In fact, to get the same blur on the 2K image as you would with the 720 image, you'd have to set the blur amount to 330 (fig. c). With a blur amount of nearly five times of that needed for a 720 image, filtering the 2K image is a waste of time and resources.

Being a really good monkey...

It's important to note that while you can achieve a decent speedup by pre-comping a large image and filtering the layer, it's still memory-wasteful. The full 2K-version of the image is still stored in system memory and takes up more space on the GPU. If I knew that I wasn't likely to blow up the image too much or need to do huge pan/scan moves, I would resize the image before bringing it into Motion, saving a chunk of memory. A 2K image takes up around 12.5MB at 8-bit, and a 720x480 image only takes about 1.4MB, so which size would you rather have shooting across from RAM to your GPU?

You can use another program (or even Motion itself) to prep still media before adding it to your project, but Motion 2.0 has a handy new feature that can do it for you. If you go into the preferences (found in Motion->Preferences), and look in the Project tab, you'll see a popup menu labeled "Large Stills". If you set that menu to "Down-Res to Canvas Size", Motion will resize images that are larger than the project to the project size...before they are imported. So if my project is 720x480 and I add a 2045x1536 image, it will arrive in Motion as a 720x480 image, ready for fast performance.

There are a few caveats to this automatic down-rezzing:

  • It's one-way: once an image has been down-rezzed, you need to re-import it to have it at a larger original size.
  • No hints: there is nothing in the UI that tells you the image has been down-rezzed, so if you forget, you're on your own.
  • It's a global preference, so if you want to do it to one image and not another, you have to keep toggling it on/off in the preferences menu.
  • Only works for stills, so you need to pre-process video by some other method.

Free at last?

Armed with an improved awareness of the significance of size, you can optimize your projects to run faster and be more aware of the limitations of your particular GPU.

But to really take control, you'll want to learn about the hidden wonders of Fixed Resolution.

* At the time of this writing, an NVIDIA 6800 Ultra (256MB)