i
i
i
i
i
i
i
i
10.5. Sprites and Layers 445
10.5 Sprites and Layers
One of the simplest image-based rendering primitives is the sprite [384]. A
sprite is an image that moves around on the screen, e.g., a mouse cursor.
The sprite does not have to have a rectangular shape, since some pixels
can be rendered as transparent. For simple sprites, there is a one-to-one
mapping with pixels on the screen. Each pixel stored in the sprite will be
put in a pixel on the screen. Animation can be generated by displaying a
succession of different sprites.
A more general type of sprite is one rendered as an image texture applied
to a polygon that always faces the viewer. The image’s alpha channel can
provide full or partial transparency to the various pixels of the sprite. This
typeofspritecanhaveadepth,andsoalocationinthesceneitself,and
can smoothly change size and shape. A set of sprites can also be used
to represent an object from different views. The illusion is fairly weak for
large objects, however, because of the jump when switching from one sprite
to another. That said, an image representation for an object from a given
view can be valid for a number of frames, if the object’s orientation and
the view do not change significantly. If the object is small enough on the
screen, storing a large set of views, even for animated objects, is a viable
strategy [266].
One way to think of a scene is as a series of layers, as is commonly
done for two-dimensional cel animation. For example, in Figure 10.3, the
tailgate is in front of the chicken, which is in front of the truck’s cab,
which is in front of the road and trees. This layering holds true for a
large set of viewpoints. Each sprite layer has a depth associated with it.
By rendering in a back-to-front order, we can build up the scene without
need for a Z-buffer, thereby saving time and resources. Camera zooms
just make the object larger, which is simple to handle with the same
sprite. Moving the camera in or out actually changes the relative cov-
erage of foreground and background, which can be handled by changing
each sprite layer’s coverage independently. As the viewer moves perpen-
dicularly to the direction of view, the layers can be moved relative to their
depths.
However, as the view changes, the appearance of the object changes.
For example, viewing a cube straight-on results in a square. As the view
moves, the square appears as a warped quadrilateral. In the same way,
a sprite representing an object can also be warped as its relation to the
view changes. As the view changes, however, new faces of the cube be-
come visible, invalidating the sprite. At such times, the sprite layer must
be regenerated. Determining when to warp and when to regenerate is one
of the more difficult aspects of image-based rendering. In addition to sur-
face features appearing and disappearing, specular highlights and shadows