Normal quotes
This commit is contained in:
parent
5e10794a24
commit
18011c595a
352 changed files with 6040 additions and 6040 deletions
40
57-01.md
40
57-01.md
|
|
@ -11,38 +11,38 @@ Chapter 57\
|
|||
I recently spent an hour or so learning how to shear a sheep. Among
|
||||
other things, I learned—in great detail—about the importance of
|
||||
selecting the proper comb for your shears, heard about the man who holds
|
||||
the world’s record for sheep sheared in a day (more than 600, if memory
|
||||
the world's record for sheep sheared in a day (more than 600, if memory
|
||||
serves), and discovered, Lord help me, the many and varied ways in which
|
||||
the New Zealand Sheep Shearing Board improves the approved
|
||||
sheep-shearing method every year. The fellow giving the presentation did
|
||||
his best, but let’s face it, sheep just aren’t very interesting. If you
|
||||
have children, you’ll know why I was there; if you don’t, there’s no use
|
||||
his best, but let's face it, sheep just aren't very interesting. If you
|
||||
have children, you'll know why I was there; if you don't, there's no use
|
||||
explaining.
|
||||
|
||||
The chap doing the shearing did say one thing that stuck with me,
|
||||
although it may not sound particularly profound. (Actually, it sounds
|
||||
pretty silly, but bear with me.) He said, “You don’t get really good at
|
||||
sheep shearing for 10 years, or 10,000 sheep.” I’ll buy that. In fact,
|
||||
pretty silly, but bear with me.) He said, "You don't get really good at
|
||||
sheep shearing for 10 years, or 10,000 sheep." I'll buy that. In fact,
|
||||
to extend that morsel of wisdom to the greater, non-ovine-centric
|
||||
universe, it actually takes a good chunk of experience before you get
|
||||
good at anything worthwhile—especially graphics, for a couple of
|
||||
reasons. First, performance matters a lot in graphics, and performance
|
||||
programming is largely a matter of experience. You can’t speed up PC
|
||||
programming is largely a matter of experience. You can't speed up PC
|
||||
graphics simply by looking in a book for a better algorithm; you have to
|
||||
understand the code C compilers generate, assembly language
|
||||
optimization, VGA hardware, and the performance implications of various
|
||||
graphics-programming approaches and algorithms. Second, computer
|
||||
graphics is a matter of illusion, of convincing the eye to see what you
|
||||
want it to see, and that’s very much a black art based on experience.
|
||||
want it to see, and that's very much a black art based on experience.
|
||||
|
||||
#### Visual Quality: A Black Hole ... Er, Art {#Heading3}
|
||||
|
||||
Pleasing the eye with realtime computer animation is something less than
|
||||
a science, at least at the PC level, where there’s a limited color
|
||||
a science, at least at the PC level, where there's a limited color
|
||||
palette and no time for antialiasing; in fact, sometimes it can be more
|
||||
than a little frustrating. As you may recall, in the previous chapter I
|
||||
implemented texture mapping in X-Sharp. There was plenty of experience
|
||||
involved there, some of which I didn’t mention. My first implementation
|
||||
involved there, some of which I didn't mention. My first implementation
|
||||
was disappointing; the texture maps shimmied and sheared badly, like a
|
||||
loosely affiliated flock of pixels, each marching to its own drummer.
|
||||
Then, I added a control key to speed up the rotation; what a difference!
|
||||
|
|
@ -53,25 +53,25 @@ threshold into being accepted by the eye as a viewed object, rather than
|
|||
simply a collection of pixels.
|
||||
|
||||
The obvious lesson here is that adequate speed is important to
|
||||
convincing animation. There’s another, less obvious side to this lesson,
|
||||
though. I’d been running the texture-mapping demo on a 20 MHz 386 with a
|
||||
convincing animation. There's another, less obvious side to this lesson,
|
||||
though. I'd been running the texture-mapping demo on a 20 MHz 386 with a
|
||||
slow VGA when I discovered the beneficial effects of greater animation
|
||||
speed. When, some time later, I ran the demo on a 33 MHz 486 with a fast
|
||||
VGA, I found that the faster rotation was too fast! The ball spun so
|
||||
rapidly that the eye couldn’t blend successive images together into
|
||||
rapidly that the eye couldn't blend successive images together into
|
||||
continuous motion, much like watching a badly flickering movie.
|
||||
|
||||
------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
 *So the second lesson is that either too little or too much speed can destroy the illusion. Unless you’re antialiasing, you need to tune the shifting of your images so that they’re in the “sweet spot” of apparent motion, in which the eye is willing to ignore the jumping and aliasing, and blend the images together into continuous motion. Only experience can give you a feel for that sweet spot.*
|
||||
 *So the second lesson is that either too little or too much speed can destroy the illusion. Unless you're antialiasing, you need to tune the shifting of your images so that they're in the "sweet spot" of apparent motion, in which the eye is willing to ignore the jumping and aliasing, and blend the images together into continuous motion. Only experience can give you a feel for that sweet spot.*
|
||||
------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
#### Fixed-Point Arithmetic, Redux {#Heading4}
|
||||
|
||||
In the previous chapter I added texture mapping to X-Sharp, but lacked
|
||||
space to explain some of its finer points. I’ll pick up the thread now
|
||||
space to explain some of its finer points. I'll pick up the thread now
|
||||
and cover some of those points here, and discuss the visual and
|
||||
performance enhancements that previous chapter’s code needed—and which
|
||||
are now present in the version of X-Sharp in this chapter’s subdirectory
|
||||
performance enhancements that previous chapter's code needed—and which
|
||||
are now present in the version of X-Sharp in this chapter's subdirectory
|
||||
on the CD-ROM.
|
||||
|
||||
Back in Chapter 38, I spent a good bit of time explaining exactly which
|
||||
|
|
@ -87,7 +87,7 @@ for speed and ease of use, would be unacceptable because round-off error
|
|||
would result in imprecise pixel placement.
|
||||
|
||||
More than a year then passed between the time I wrote that statement and
|
||||
the time I implemented X-Sharp’s texture mapper, during which time my
|
||||
the time I implemented X-Sharp's texture mapper, during which time my
|
||||
long-term memory apparently suffered at least partial failure. When I
|
||||
went to implement texture mapping for the previous chapter, I decided
|
||||
that since transformed destination vertices can fall at fractional pixel
|
||||
|
|
@ -99,8 +99,8 @@ one small problem: gaps between polygons.
|
|||
|
||||
Yes, folks, I had ignored the voice of experience (my own voice, at
|
||||
that) at my own peril. You can be assured I will not forget this
|
||||
particular lesson again: Fixed-point arithmetic is not precise. That’s
|
||||
not to say that it’s impossible to use fixed-point for drawing polygons;
|
||||
particular lesson again: Fixed-point arithmetic is not precise. That's
|
||||
not to say that it's impossible to use fixed-point for drawing polygons;
|
||||
if all adjacent edges share common start and end vertices and common
|
||||
edges are always stepped in the same direction, all polygons should
|
||||
share the same fixed-point imprecision, and edges should fit properly
|
||||
|
|
@ -120,7 +120,7 @@ appear to have shifted by one pixel at the corresponding destination
|
|||
pixel; given all the aliasing and shearing already going on in the
|
||||
texture-mapping process, a one-pixel mapping error is insignificant.
|
||||
|
||||
Experience again: It’s the difference between knowing which flaws (like
|
||||
Experience again: It's the difference between knowing which flaws (like
|
||||
small texture shifts) can reasonably be ignored, and which (like those
|
||||
that produce gaps between polygons) must be avoided at all costs.
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue