Professional Documents
Culture Documents
CS 551/651: Advanced Computer Graphics: Antialiasing Continued: Prefiltering and Supersampling
CS 551/651: Advanced Computer Graphics: Antialiasing Continued: Prefiltering and Supersampling
David Luebke
8/19/2012
Pros:
Guaranteed
Cons:
Expensive
Can
David Luebke
8/19/2012
Pros:
Conceptually
simple Easy to retrofit existing renderers Works well most of the time
Cons:
High
storage costs Doesnt eliminate aliasing, just shifts Nyquist limit upwards
David Luebke 3 8/19/2012
Pros:
Integrating
Cons:
Still
Stochastic Sampling
Sampling theory tells us that with a regular sampling grid, frequencies higher than the Nyquist limit will alias Q: What about irregular sampling? A: High frequencies appear as noise, not aliases This turns out to bother our visual system less!
David Luebke
8/19/2012
Stochastic Sampling
An intuitive argument:
In stochastic sampling, every region of the image has a finite probability of being sampled Thus small features that fall between uniform sample points tend to be detected by non-uniform samples
David Luebke
8/19/2012
Stochastic Sampling
Ray tracing:
It
example: REYES system (?) Using image jittering is easier (more later)
A-buffer: nope
Totally
David Luebke
8/19/2012
Stochastic Sampling
Idea: randomizing distribution of samples scatters aliases into noise Problem: what type of random distribution to adopt? Reason: type of randomness used affects spectral characteristics of noise into which high frequencies are converted
David Luebke
8/19/2012
Stochastic Sampling
David Luebke
8/19/2012
Stochastic Sampling
Poisson distribution:
Completely random Add points at random until area is full. Uniform distribution: some neighboring samples close together, some distant
David Luebke
10
8/19/2012
Stochastic Sampling
Poisson distribution, with minimum-distance constraint between samples Add points at random, removing again if they are too close to any previous points Very even-looking distribution
David Luebke
11
8/19/2012
Stochastic Sampling
Jittered distribution
Start with regular grid of samples Perturb each sample slightly in a random direction More clumpy or granular in appearance
David Luebke
12
8/19/2012
Stochastic Sampling
Poisson: completely uniform (white noise). High and low frequencies equally present Poisson disc: Pulse at origin (DC component of image), surrounded by empty ring (no low frequencies), surrounded by white noise Jitter: Approximates Poisson disc spectrum, but with a smaller empty disc.
David Luebke
13
8/19/2012
Stochastic Sampling
Watt & Watt, p. 134 See Foley & van Dam, p 644-645
David Luebke
14
8/19/2012
Nonuniform Supersampling
Adaptive supersampling:
Sample
(say) once per pixel, then supersample if intensity changes a lot multiple samples per pixel, but not on a uniform
Stochastic supersampling:
Use
grid
David Luebke
Nonuniform Supersampling
I(x,y) = I(i, j) h(x-i, y-j) Can we use this equation for nonuniform sampling? Implicit in this equation is a normalizing factor: we assume the filter weights sum to unity
David Luebke 16 8/19/2012
Nonuniform Supersampling
Pixel
David Luebke 17 8/19/2012
Nonuniform Supersampling
Sampling Grid
David Luebke 18 8/19/2012
Nonuniform Supersampling
Polygon
David Luebke 19 8/19/2012
Nonuniform Supersampling
Adaptive Sampling
David Luebke 20 8/19/2012
Nonuniform Supersampling
Problem:
Many more purple samples than white samples But final pixel actually more white than purple! Simple filtering will not handle this correctly
Final Samples
David Luebke 21 8/19/2012
Nonuniform Supersampling
Divide total value of samples X filter by total value of filter at sample points:
David Luebke
22
8/19/2012
Nonuniform Supersampling
Use weighted-average filters in cascade, sequentially applying filters with lower and lower cutoff frequencies
David Luebke
23
8/19/2012
Nonuniform Supersampling
Keep random components small compared to filter width Use standard supersampling filter Cook 87 (REYES) uses 4x4 jittered supersampling
David Luebke
24
8/19/2012
David Luebke
25
8/19/2012
David Luebke
26
8/19/2012
pixel covers entire checkerboard Unfiltered mapping: pixel is black or white Moving checkerboard flashing pixels
David Luebke
27
8/19/2012
David Luebke
28
8/19/2012
Mip-mapping
MIP = Multim in Parvo (many things in a small place) Ignores shape change of inverse pixel But allows size to vary
Idea: store texture as a pyramid of progressively lower-resolution images, filtered down from original
David Luebke
29
8/19/2012
Antialiasing: Mip-Mapping
Depth of Mip-Map
David Luebke 30 8/19/2012
R G B
R G R G B B
G B
31 8/19/2012
David Luebke
David Luebke
32
8/19/2012
Think of mip-map as 3-D pyramid Index into mip-map with 3 coordinates: u, v, d (depth)
David Luebke
33
8/19/2012
The size of the filter (i.e., d in the mip-map) depends on the pixel coverage area in the texture map
In general, treat d as a continuous value Blend between nearest mip-map level using linear interpolation
David Luebke
34
8/19/2012
David Luebke
35
8/19/2012
The End
David Luebke
36
8/19/2012