Graphics Reference
In-Depth Information
frequencies don't matter. Of course, a high frequency that aliases to a low fre-
quency that we can detect does matter. But if some line-rendering approach leaves
in a few components that are just above the Nyquist limit, their aliases will be just
below the Nyquist limit, which may be well above the range of frequencies our
eyes can detect, and therefore may not matter at all.
The third failure is of a larger kind: We've taken the view that we must first
band-limit, then sample, then reconstruct, and we've looked at each step sepa-
rately, and accepted approximations in each one. To some degree, we've approxi-
mated the steps of the solution rather than the solution itself violating the Approx-
imate the Solution Principle. Here's an alternative problem to consider: Among all
possible patterns of light that the display can produce, which one is L 2 closest to
the function f ? If we know that we're going to be displaying the result on a square-
pixel LCD screen, isn't this a reasonable question to be asking? It turns out that the
solution to this “nearest displayable image” problem is produced by unweighted
area sampling. But actually using unweighted area sampling generates some inter-
esting artifacts of its own: Vertical and horizontal lines look sharper, indeed are
sharper, than diagonal ones, and lines in horizontal motion appear to speed up and
slow down as we saw in the case of the moving triangle at the start of the chapter.
Does this matter? That depends on our eyes' ability to detect variations in speed of
motion for various speeds. You might want to write a program to experiment with
this and draw your own conclusions. The real lesson of this example is that it's
worth thinking about sampling and reconstruction together rather than as separate
processes.
18.21 Discussion and Further Reading
If we want an image (i.e., a rectangular array of samples from some function f )to
be faithfully reconstructible (i.e., we want to be able to recover f from the sam-
ples), then the process that generated the image must be lossless (i.e., an invertible
map of vector spaces). In general, this requires that we restrict the original func-
tion to some subset of L 2 , and the usual choice is “the band-limited functions.”
Unfortunately, in practice we're often confronted with functions we'd like to
sample but which are not band-limited. The solution is to find a way to convert
such a function f into a nearby function f 0 that is band-limited. The ideal way to
do so is to convolve f with a sinc, but that's impractical in general. Convolving
with other, simpler, filters like the box can give a decent approximation.
In practice, this means that if you want to write a ray tracer, you shouldn't just
sample one ray at the center of each pixel. Instead, you should shoot many rays
per pixel and average them. This is a low-budget approximation of box-filtering
the “incoming light” function. Alternatively, you could compute a weighted sum
of the ray values, approximating the convolution of the incoming light with some
filter like the sinc or the tent, or any other filter you like.
Although the sinc filter is the ideal “low-pass” filter, it has some problems
in practice. If you have a wide box function, for instance, and you filter it with
sinc, the result contains ringing —little wiggles on either side of the discontinuity.
That's not “wrong” in any sense, but it presents a problem for display: Because
some of the resultant values are negative, you want to make those parts of your
display “even blacker than black,” which is impractical. This is yet another reason
to favor a tent filter, or some other everywhere-positive approximation of a sinc.
 
 
Search WWH ::




Custom Search