Graphics Reference
In-Depth Information
function f that's 1 for any point ( x , y ) whose distance to the line is less than 2 ,
and 0 otherwise. This function can be described as the “Am I in a unit-width stripe
defined by y = mx + b ” function. This function has sharp transitions from black
to white (or 0 to 1), so its (two-dimensional) Fourier transform contains arbitrarily
high frequencies. In fact, any horizontal slice of this function (i.e., x
f ( x , y 0 ) )
looks like a bump of some width, and hence its 1D Fourier transform looks like
a sinc, which is nonzero for arbitrarily high frequencies. The function f is not in
L 2 ( R 2 ) , but outside the image we're going to render—say, a 100
100 image—we
can define f to be 0, and then it will be in L 2 . Our goal is to have the pattern of
light emitted by the display be as near to a band-limited approximation of f (or a
multiple of it, to deal with units) as possible.
The “rounding” approach turns out to be equivalent to sampling a slightly fat-
ter version of the function f : The pixel ( x , y ) is “illuminated” if its vertical distance
to y = mx + b is no more than 2 . The samples of this function constitute an
×
2
function on the integer grid. Its spectrum is the result of convolving the spectrum
of f with a two-dimensional comb, resulting in many high-frequency components
aliasing as low-frequency ones. Displaying these samples on the LCD monitor
amounts to convolving the image with a 2D box function, that is, multiplying by
a (2D) sinc in the frequency domain. So the rounding approach, in the frequency
domain, looks like convolution with a comb, followed by multiplication by a sinc.
The end result is nowhere near a band-limited approximation of the function f ,
and the result, as we saw, looks bad.
In the next approach to line rendering, there were three steps.
1. Convolve with a 2D box to compute area overlaps.
2. Sample at integer points.
3. Convolve with a 2D box to display.
In frequency space, we multiply
( f ) by a sinc, convolve with a 2D comb,
and then multiply by sinc again. As we already saw, multiplying f by sinc weakly
band-limits it—too-high frequencies are attenuated, although not perfectly.
Convolution with the comb introduces the high-frequency parts that passed the
weak band limiting as low-frequency aliases. And multiplying by sinc again
weakly band-limits the results. The effect of the extra sinc in the first step is notice-
able, and the grayscale line rendering is far nicer.
In weighted area sampling, the first step is replaced by convolution with a 2D
tent rather than a 2D box; in the frequency domain, we're multiplying by sinc 2 ,
which is a far more effective band limiter. The final results are correspondingly
better.
In the last two cases, we've only approximately band-limited during the sam-
pling process; in the first one, we never band-limited at all. And in all cases, the
display process produces an image that contains a great many high frequencies at
the edges between display pixels. But we have, at least in the last two cases, got
an approximation of the ideal solution.
Or have we? We've actually failed in three ways. First, the notion of “near-
ness” used in this chapter is the L 2 distance, and we've already mentioned that
this doesn't actually correspond very closely to a perceptual notion of similar-
ity of images, so it's possible that we've optimized for the wrong thing. Second,
we've been concerned about high frequencies, but in practice, once the pixels
are small enough that the high-frequency components of the pattern of emitted
light are so high-frequency that we cannot detect them with our eyes, these high
F
Search WWH ::




Custom Search