TGLTLSBFSSP: Motion Blur

Motion Blur


What is Motion Blur ?
Motion blur is an effect you will see in photographs of scenes where objects are moving. It is mostly noticeable when the exposure is long, or if objects in the scene are moving rapidly.

Why does it happen ?
A camera works by exposing a sheet of light sensitive film to a scene, for a short period of time. The light from the scene, hitting the film, causes the film to change chemically, and eventually results in a picture representation of the scene. This is known as an exposure. If the scene changes during that exposure, a blurred image will result.

Why should you bother ?
You will see motion blur to some extent in almost every film and TV program. It is likely, however, that you will not notice it. Like many artifacts of photography, you only usually notice it's absence, and it's presence gives an air of realism.

For example, you may have seen that lens flare has become a popular effect recently. Traditional photographers often try to reduce it's effect, but since we recognize it as an artifact of reality, computer graphicians make the effort to simulate it. The same goes for the grain on film, the wobble of a camera being held in the hand or mounted on a helicopter, focus effects, and many others.

Take a look at some computer animations that do not contain rendered motion blur, and you will see that fast movement looks jerky and unrealistic. You might also notice this effect in TV coverage of sporting events. Whereas most TV programs are filmed with cameras that take about 25 frames per second, sporting cameras can take up to 1000 frames per second, giving excellent sharp slow motion replays. However they broadcast only a small fraction of these frames, which reduces the amount of motion blur, and so fast moving objects seem to flicker.

We are all so used to seeing motion blur in TV programs and films, that to see motion without it looks a little unrealistic. The lack of motion blur is one of the (many) reasons that computer generated animation can look unreal. This lack of realism is caused by the sharpness of motion in computer animations is quite noticeable, and can really spoil the effect.

Additionally, an image with motion blur holds more information that one without. Compare these two images:
These two frames show identical scenes, but one is taken from an animation where the camera is travelling forwards quickly, in the other, the camera is moving to the left. Is should be obvious which is which. During an animation, your brain will notice this extra information, the motion will appear smoother, and the final effect will be a more realistic animation.


In more detail ?
We will consider how a movie camera takes pictures of a moving scene.

A movie camera consists of the following parts:

The image on the right shows a stationary red sphere being filmed by a movie camera. Just the three important parts of the camera, the Lens, Shutter and Film are shown.

You can see that the shutter is open, letting light onto the film. If you look at the film, you will see the two previous frames that have been exposed, and the current frame being exposed. That frame is slightly darker than the other two, as the shutter has only been open for a short time (a small fraction of a second). In another fraction of a second, the shutter will close again, leaving that frame fully exposed, and as bright as the other two.

After the shutter closes, the film will move down a bit to ready the next frame for exposure. The shutter will then open again, and the process repeats many times a second.

This image shown the same thing happening again. This time however, the sphere is moving quickly in the direction of the arrow.

The shutter opens, and the image begins to form on the film. However, while the shutter is open, the sphere is moving. This movement causes the image on the film to be blurred. This is known as motion blur.

Now, I'd be willing to bet that if you looked at any one of those motion-blurred frames, you would be able to guess that the sphere was moving horizontally when it was filmed. A frame with motion blur carries more information than a frame without.


Creating the effect of Motion Blur in an Image

1: Spatial anti-aliasing
You may well be familiar with one method of anti-aliasing, known as super sampling. This method involves rendering an image much larger than you want it, then reducing the size by averaging groups of pixels into one. I will take you through the method of creating anti-aliased images first, because creating motion blur is very similar.

For example, to render an anti-aliased image of a red circle, at a resolution of 50x50:
1: Render too many pixels
You would first draw an un-anti-aliased circle at a higher resolution. In this case, I have chosen a resolution of 200x200, which is four times too big in each dimension.
2: Divide the image
Then, imagine dividing the image into little squares. Since this high resolution image is 4 times too big, we choose each little square to be 4x4 pixels in size.
3: Average
Now, for each little square, take the average values of all the pixels inside it. Fill the little square with that average value.
4: Resize
Finally, resize the image down to 50x50. And there you have it. One anti-aliased red circle.

2: Temporal anti-aliasing (Motion Blur)

Now, a similar thing can be done to achieve motion blur. The method for creating smooth images is known as Spatial Anti-aliasing (means smoothing out space), and the method for creating smooth motion in animations is known as Temporal Anti-aliasing (means smoothing out time).

It is analogous to the method used to anti-alias images.

1: Render too many frames
Just as you rendered the images much larger to start with, so you should also render the animations much longer. For example, to create a 4 second animation with 100 motion-blurred frames, you might begin by rendering 400 frames. These 400 frames would cover the same 4 seconds, but would occur 4 times more frequently in time.

For example, on the left, you can see that frames have been rendered 1/100th of a second apart.

2: Divide the frames
Next, take groups of 4 frames . . .

3: Average
. . . and mix them together evenly.

4: Done
You now have a 25 frames per second animation. The motion-blurred frames on the right are 1/25th of a second apart.


What does this mean to the programmer?
So, should you try to model motion blur in your programs? Well, that depends a great deal on what kind of program it is.

Motion blur can be very hard to model in real-time applications. It requires that you increase the frame-rate several times. And for real-time applications, the only way to do this is to render with much less detail. For most programmers, this is unacceptable.

Correct Motion Blur
Some computer games try to simulate motion blur by blending the current frame with the previous frames, so that previous frames are still visible for a moment. This makes moving objects smear across the screen. This is not real motion blur; it does not look good and is a waste of processor power.
False Motion Blur
You could probably achieve reasonable motion blur in a game if you were willing to sacrifice a lot of detail. You can often, however, add a little motion blur. You might be able to blur just those things that are moving fast enough. For example, the sparks given off in an explosion could be rendered as little lines, rather than dots, giving the effect of blur (see my Starfield Article). The same goes for water falls and the shots from weapons. Often, when I play a racing games, I am disappointed by the absence of motion blur on the wheels of the cars. Car wheels spin so fast that you should not be able to see any detail on them at all. One solution is this: Several textures are stored for the wheels, with varying amounts of blur. As the wheels spin faster and faster, more and more blurred textures are used. The same thing applies for the road texture. This would have an effect on the realism of the game.

If you are rendering a non-real-time animation, then it is well worth going to the extra trouble to add motion blur, especially if the motion is fast. It is not always desirable however. For example, if you want to be able to pause the animation, and see the images sharply, then you may want to reduce, or ignore, the blur altogether. If you have the film Out of Sight with George Clooney, watch the beginning, where George comes out of the bank, and chucks his tie on the floor. As the camera pans around, you might notice that it looks a little bit jerky or flickery. The film pauses occasionally to catch a car speeding past, and George in the act of throwing his tie down. Even though they were moving quite quickly, they still don't seem to have suffered a great deal from motion blur. This is because the film makers used a high speed film, and reduced the exposure time a great deal, so that the paused shots appeared sharp.


Motion Blur Demo
Here's a real-time demo showing a cube rushing round the screen. You can use the following keys:
S:
M:
3:
up/down arrows:
left/right arrows:
ESC:
Toggle slow motion
Toggle between correct and false motion blur
Toggle Red/Blue 3D mode
more/less motion blur accuracy
adjust background brightness
quit

Real-time Motion Blur Demo


Motion Blur Animation
The frames of this animation were rendered in Terragen. Spatial and Temporal anti-aliasing were then applied with Bitty, and finally the animation was created with Bink. You will need the bink player, which you can download for free from their web site.

Format :
Resolution :
Frames :
FPS :
File Size :
Bink (.BIK)
320x240
160
25
1379 Kb


fly2.zip (1.3Mb) : 160 frames : Bink Format


References

Bitty http://parnham.future.easyspace.com/
Bitty is a little program, that can perform Spatial and Temporal anti-aliasing (motion blur). You can give it the frames from a rendered animation, and it will mix them together to create the effect of motion blur. It can also resample the frames down as it goes. It does not create animation files, but outputs another set of frames that must then be compiled into a .MPG, .AVI or .BIK (bink!) video file.

Terragen Motion Blurred Animations http://parnham.future.easyspace.com/animations.htm
Dan has made some great animations using Terragen to render the frames, and Bitty to mix them. There are and excellent demonstration of motion blur.

Bink! http://www.smacker.com
Bink is an amazing new video compression codec, easily outperforming MPEG-II and AVI. It is a very new system and is not yet as well supported as .MPG or .AVI. However I do hope it will gain the recognition it deserves. I shall be creating all my animations in this format from now on.


Return to the Good Looking Textured Light Sourced Bouncy Fun Smart and Stretchy Page.