CGII Pres5
CGII Pres5
Advanced Rendering
Techniques
Q: Give a
simple scene
containing
infinite
frequencies
A: A checkered
ground plane
receding into
the background
Supersampling
Create virtual image at higher
resolution than the final
image
This is easy
Supersampling
Apply a low-pass filter
Convert to frequency domain
Multiply by a box function
Triangle
Gaussian
=
1 2 1 2 4 2
2 4 2 1 2 1
1 2 1
…
Supersampling
Typical supersampling algorithm:
Compute multiple samples per pixel
Combine sample values for pixel’s value
using simple average
Q: What filter does this equate to?
A: Box filter -- one of the worst!
Q: What’s wrong with box filters?
Passes infinitely high frequencies
Attenuates desired frequencies
Supersampling
In Practice
Sinc function: ideal but
impractical
One approximation: sinc2
Another: Guassian falloff
Q: How wide (what res) should
filter be?
A: As wide as possible!
In practice: 3x3,
5x5, at most 7x7
Supersampling:
Summary
Supersampling improves aliasing
artifacts by shifting the Nyquist
limit
It works by calculating a high-res
image and filtering down to final res
“Filtering down” means simultaneous
convolution and resampling
This equates to a weighted average
Wider filterbetter resultsmore work
Supersampling:
Cons & Pros
Supersampling cons
Doesn’t eliminate aliasing, just shifts
the Nyquist limit higher
• Can’t fix some scenes (e.g., checkerboard)
Badly inflates storage requirements
Supersampling pros
Relatively easy
Often works all right in practice
Can be added to a standard renderer
Catmull’s Algorithm
A2
Find fragment
areas
A1
Multiply by
fragment
colors
Sum for final
pixel color
AB A3
Catmull’s Algorithm
First real attempt to filter
in continuous domain
Very expensive
Clipping polygons to fragments
Sorting polygon fragments by
depth
Equates to box filter
The A-Buffer
Idea: approximate continuous filtering
by subpixel sampling
Summing areas now becomes simple
The A-Buffer
Advantages:
Incorporating into scanline
renderer reduces storage costs
dramatically
Processing per pixel depends only
is full.
Uniform distribution: some
random direction
More “clumpy” or granular in
appearance
Stochastic Sampling
Spectral characteristics of these
distributions:
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.
Comparison
Regular Random
Poisson Jitter
disk
Recap:
Antialiasing Strategies
Prefiltering: low-pass filter
the signal before sampling
Pros:
• Guaranteed to eliminate aliasing
• Preserves all desired frequencies
Cons:
• Expensive
• Can introduce “ringing”
• Doesn’t fit most rendering algorithms
Recap:
Antialiasing Strategies
Supersampling:sample at
higher resolution, then
filter down
Pros:
• Conceptually simple
• Easy to retrofit existing renderers
• Works well most of the time
Cons:
• High storage costs
• Doesn’t eliminate aliasing, just
shifts Nyquist limit upwards
Recap:
Antialiasing Strategies
A-Buffer: approximate
prefiltering of continuous signal
by sampling
Pros:
• Integrating with scan-line renderer
keeps storage costs low
• Can be efficiently implemented with
clever bitwise operations
Cons:
• Still basically a supersampling approach
• Doesn’t integrate with ray-tracing
Recap:
Antialiasing Strategies
Stochastic supersampling:
convert high frequencies into
noise
Pros:
• Retains advantages of supersampling
• Noise is visually better than
aliasing
Cons:
• Ideal sampling distribution (Poisson
Disc) is expensive
Go to Suffern Slides
Wrap Up
Discuss next programming
assignment
Add adaptive supersampling
Discuss
status/problems/issues with
this week’s programming
assignment