Next: Advanced Lighting Up: Aliasing and Anti-Aliasing Previous: Aliasing and Anti-Aliasing

# Introduction

Signal Processing

• Raster Image is a sampling of a continuous function
• If samples spaced too far apart, then don't get true representation of scene:

• In graphics, a variety of bad things happen:
• Stairstep or ``jaggies''
• Moire Patterns
• Loss of small objects
• Temporal
• Sampled too far apart in time

Backwards rotating wheels

• Crawling jaggies
• Appearing/dissappearing objects, flashing objects

Image as a signal

• Signal processing signal is function of time
• Scene is a function of space

Spatial domain: f(u)

• Raster image is a sampling of this signal
• Can represent sinal as sum of sine waves

Frequency domain: F(u)

• Regular sampling restricts frequencies at which we sample

Nyquist Limit

• Theory tells us that we must sample at twice the highest frequency in the image to avoid aliasing.
• This sampling rate is known as the Nyquist Limit

• Problem: Man made objects have distinct edges

Distinct edges have infinite frequency

What to do?

• After we get image, run through low pass filter

This helps, but not a full solution

• Get a Higher Resolution Monitor

This helps, but...

• Not usually feasible
• Alleviates jaggies but
• Moire patterns merely shifted
• Small objects still vanish
• Increased CPU spent on extra pixels can be put to better use.
• Smarter sampling

Area Sampling

Rather than sample, we could integrate.

For lines, this means treating them as boxes

• Colour shades of gray based on fraction of pixel covered
• Gives better looking images at a sufficiently far distance

Look close ant it looks blurry

Weighted Sampling

• Unweighted sampling is a box filter

• No contribution outside of pixel
• All contributions are equal
• Weighted sampling
• Give different weights depending on position in pixel

• Filter may extend outside of pixel

Avoids certain temporal aliasing problems

``Correct'' filter is infinite

Anti-aliasing in Ray Tracing

• Can't always integrate area under pixel
• For ray tracing, we want to point sample the image
• Super Sampling

Take more samples and weight with filter

If sampling pattern regular, we still get aliasing

• Stocastic Sampling
• Idea: Eye easily detects coherent errors (aliasing)

Eye is poor at detecting incoherent errors (noise)

• Rather than regular supersampling, we ``jitter'' the samples in one of several ways:
• Choose random location within pixel
• Displace small, random distances from regular grid

Next: Advanced Lighting Up: Aliasing and Anti-Aliasing Previous: Aliasing and Anti-Aliasing

CS488/688: Introduction to Interactive Computer Graphics
University of Waterloo
Computer Graphics Lab

cs488@cgl.uwaterloo.ca