Nima Kalantari
CSCE 441 - Computer Graphics
Antialiasing
Some slides from Ren Ng
Rasterization
This is Displayed
Compare: The Continuous Triangle Function
What’s Wrong With This Picture?
Jaggies!
Jaggies (Staircase Pattern)
Is this the best we can do?
Outline
Sampling
Rasterization = Sample 2D Positions
Photograph = Sample Image Sensor Plane
Video = Sample Time
Harold Edgerton Archive, MIT
Sampling Artifacts in Graphics and Imaging
Jaggies (Staircase Pattern)
This is also an example of “aliasing” – a sampling error
Moiré Patterns in Imaging
lystit.com
Read every sensor pixel
Skip odd rows and columns
Wagon Wheel Illusion (False Motion)
Created by Jesse Mason, https://www.youtube.com/watch?v=QOwzkND_ooU
Aliasing in video
Slide by Steve Seitz
Aliasing in video
Sampling Artifacts in Computer Graphics
Antialiasing
Video: Point vs Antialiased Sampling
Point in Time
Motion Blurred
Video: Point Sampling in Time
30 fps video. 1/800 second exposure is sharp in time, causes time aliasing.
Credit: Aris & cams youtube, https://youtu.be/NoWwxTktoFs
Rasterization: Point Sampling in Space
Note jaggies in rasterized triangle �where pixel values are pure red or white
Sample
Rasterization: Antialiased Sampling
Pre-Filter
Sample
Note antialiased edges in rasterized triangle�where pixel values take intermediate values
Point Sampling
Antialiased
Aliasing and Antialiasing
Outline
Sines and Cosines
Frequencies
Fourier Transform
of sines and cosines
Joseph Fourier 1768 - 1830
f0 +
Extension to 2D
Image as a sum of basis images
=
Constant
Frequency Domain
(0,0)
Spatial Domain
— frequency 1/32; 32 pixels per cycle
Max signal freq =1/32
(0,0)
Frequency Domain
Spatial Domain
— frequency 1/16; 16 pixels per cycle
Max signal freq =1/16
(0,0)
Frequency Domain
Spatial Domain
Frequency Domain
Spatial Domain
2D Frequency Space
Note: Frequency domain also known as frequency space, Fourier domain, spectrum, …
Frequency Domain
Spatial Domain
Sampling
© 2006 Steve Marschner
Undersampling
© 2006 Steve Marschner
Undersampling
© 2006 Steve Marschner
Moiré Patterns in Imaging
lystit.com
Read every sensor pixel
Skip odd rows and columns
Higher Frequencies Need Faster Sampling
x
f1(x)
f2(x)
f3(x)
f4(x)
f5(x)
f2(x)
f1(x)
f3(x)
f4(x)
f5(x)
Periodic sampling locations
Low-frequency signal: sampled adequately for reasonable reconstruction
High-frequency signal is insufficiently sampled: reconstruction incorrectly appears to be from a low frequency signal
Nyquist Theorem
Signal Interval
Maximum Acceptable
Sampling Interval
Nyquist Theorem
Nyquist Theorem
Nyquist Theorem
Antialiasing
Outline
Rasterization: Point Sampling in Space
Note jaggies in rasterized triangle �where pixel values are pure red or white
Sample
Rasterization: Antialiased Sampling
Pre-Filter
Sample
Note antialiased edges in rasterized triangle�where pixel values take intermediate values
A Practical Pre-Filter
Spatial Domain
Antialiasing By Averaging Values in Pixel Area
Antialiasing by Computing Average Pixel Value
1 pixel width
Super Sampling Antialiasing (SSAA)
Supersampling
4x4 supersampling
Point Sampling: One Sample Per Pixel
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
Supersampling: Step 1
2x2 supersampling
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
Supersampling: Step 2
2x2 supersampling
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
Supersampling: Step 2
2x2 supersampling
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
Supersampling: Step 2
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
Supersampling: Result
This is the corresponding signal emitted by the display
75%
75%
100%
50%
50%
50%
50%
25%
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
Point Sampling
4x4 Supersampling
Sample Locations
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
(0,h)
(w,h)
(0,0)
(w,0)
Regular sampling: sample location for pixel (i,j)
(i+1/2,j+1/2)
Sample Locations
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
(i+1/4,j+3/4)
(i+1/4,j+1/4)
(i+3/4,j+1/4)
(i+3/4,j+3/4)
2x2 supersampling: locations for pixel (i,j)
(0,h)
(w,h)
(0,0)
(w,0)