i
i
i
i
i
i
i
i
444 10. Image-Based Effects
detect much inaccuracy in reflections. Parallax is much more obvious when
directly viewed. As such, a skybox typically contains only elements such
as the sun, sky, distant (unmoving) clouds, and mountains.
For a skybox to look good, the cube map texture resolution has to be
sufficient, i.e., a texel per screen pixel [1154]. The formula for the necessary
resolution is approximately
texture resolution =
screen resolution
tan(fov/2)
, (10.1)
where fov is the field of view. This formula can be derived from observing
that the texture of one face of the cube map must cover a field of view
(horizontally and vertically) of 90 degrees.
Other shapes than a box surrounding the world are commonly used.
For example, Gehling [385] describes a system in which a flattened dome
is used to represent the sky. This geometric form was found best for simu-
lating clouds moving overhead. The clouds themselves are represented by
combining and animating various two-dimensional noise textures.
10.4 Light Field Rendering
Radiance can be captured from different locations and directions, at dif-
ferent times and under changing lighting conditions. In the real world, the
burgeoning field of computational photography explores extracting various
results from such data [1048]. Some purely image-based representations of
an object can be used for modeling. For example, the Lumigraph [429] and
light-field rendering [767] techniques attempt to capture a single object
from a set of viewpoints. Given a new viewpoint, these techniques per-
form an interpolation process between stored views in order to create the
new view. This is a complex problem, with a very high data requirement
(tens of megabytes for even small image sets). Related research on surface
light fields [1366] and “Sea of Images” [21] provide useful compression tech-
niques. The concept is akin to holography, where a two-dimensional array
of views captures the object. A tantalizing aspect of the Lumigraph and
light-field rendering is the ability to capture a real object and be able to
redisplay it from any angle. Any object, regardless of surface and lighting
complexity, can be displayed at a nearly constant rate [1184]. As with the
global illumination end of the rendering spectrum, these techniques cur-
rently have limited use in interactive rendering, but they demarcate what
is possible in the field of computer graphics as a whole.
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
i
i
i
i
i
i
i
i
446 10. Image-Based Effects
Figure 10.3. A still from the animation Chicken Crossing, rendered using a Talisman
simulator. In this scene, 80 layers of sprites are used, some of which are outlined and
shown on the left. Since the chicken wing is partially in front of and behind the tail-
gate, both were placed in a single sprite. (Reprinted with permission from Microsoft
Corporation.)
can also change, making a system based purely on sprites difficult to use
efficiently.
This layer and image warping process was the basis of the Talisman
hardware architecture espoused by Microsoft in the late 1990s [1204, 1268].
Pure image-layer rendering depends on fast, high-quality image warping,
filtering, and compositing. While such pure systems have serious draw-
backs, the idea of representing a model by one or more image-based rep-
resentations has been found to be fruitful. Image-based techniques can
be combined with polygon-based rendering. The following sections discuss
impostors, depth sprites, and other ways of using images to take the place
of polygonal content.
10.6 Billboarding
Orienting a textured polygon based on the view direction is called bill-
boarding, and the polygon is called a billboard [849]. As the view changes,
i
i
i
i
i
i
i
i
10.6. Billboarding 447
the orientation of the polygon changes. Billboarding, combined with alpha
texturing and animation, can be used to represent many phenomena that
do not have smooth solid surfaces. Vegetation, especially grass, is an ex-
cellent candidate for this type of technique. Smoke, fire, fog, explosions,
energy shields, vapor trails, and clouds are just a few of the objects that
can be represented by these techniques [849, 1342].
A few popular forms of billboards are described in this section. In
each, a surface normal and an up direction are found for orienting the
polygon, usually a quadrilateral. These two vectors are sufficient to create
an orthonormal basis for the surface. In other words, these two vectors
describe the rotation matrix needed to rotate the quadrilateral to its final
orientation (see Section 4.2.4). An anchor location on the quadrilateral
(e.g., its center) is then used to establish its position in space.
Often, the desired surface normal n and up vector u are not perpendic-
ular. In all billboarding techniques, one of these two vectors is established
as being a fixed vector that must be maintained in the given direction. The
processisalwaysthesametomaketheother vector perpendicular to this
fixed vector. First, create a “right” vector r, a vector pointing toward the
right edge of the quadrilateral. This is done by taking the cross product
of u and n. Normalize this vector r, as it will be used as an axis of the
orthonormal basis for the rotation matrix. If vector r is of zero length, then
u and n must be parallel and the technique [576] described in Section 4.2.4
can be used.
The vector that is to be adjusted (i.e., is not fixed), either n or u,
is modified by taking the cross product of the fixed vector and r,which
creates a vector perpendicular to both. Specifically, if the normal n is fixed
(as is true for most billboarding techniques), then the new up vector u
is
u
= n × r. (10.2)
This process is shown in Figure 10.4. If instead, the up direction is fixed
(true for axially aligned billboards such as trees on landscape), then the
new normal vector n
is
n
= r × u. (10.3)
The new vector is then normalized and the three vectors are used to
form a rotation matrix. For example, for a fixed normal n and adjusted up
vector u
the matrix is
M =
r, u
, n
. (10.4)
This matrix transforms a quadrilateral in the xy plane with +y pointing
toward its top edge, and centered about its anchor position, to the proper
orientation. A translation matrix is then applied to move the quadrilat-
eral’s anchor point to the desired location.
i
i
i
i
i
i
i
i
448 10. Image-Based Effects
Figure 10.4. Given a desired surface normal direction n andanapproximateupvector
direction u, we wish to establish a set of three mutually perpendicular vectors to orient
the billboard. In the middle figure, the “right” vector r is found by taking the cross
product of u and n, and so is perpendicular to both of them. In the right figure, the
fixed vector n is crossed with r to give a mutually perpendicular up vector u
.
With these preliminaries in place, the main task that remains is deciding
what surface normal and up vector are used to define the billboard’s orien-
tation. A few different methods of constructing these vectors are discussed
in the following sections.
10.6.1 Screen-Aligned Billboard
The simplest form of billboarding is a screen-aligned billboard.Thisform
is similar to a two-dimensional sprite, in that the image is always parallel
to the screen and has a constant up vector. For this type of billboard
the desired surface normal is the negation of the view plane’s normal. This
view direction is a constant vector v
n
that the camera looks along, in world
space. The up vector u is from the camera itself. It is a vector in the view
plane that defines the camera’s up direction. These two vectors are already
perpendicular, so all that is needed is the “right” direction vector r to form
the rotation matrix for the billboard. Since n and u are constants for the
camera, this rotation matrix is the same for all billboards of this type.
Screen-aligned billboards are useful for information such as annotation
text, as the text will always be aligned with the screen itself (hence the
name “billboard”).
10.6.2 World-Oriented Billboard
The previous billboarding technique can be used for circular sprites such as
particles, as the up vector direction actually is irrelevant for these. If the
camera rolls, i.e., rotates along its view direction axis, due to symmetry,
the appearance of each sprite does not change.
For other sprites, the camera’s up vector is normally not appropriate.
If the sprite represents a physical object, it is usually oriented with respect
to the world’s up direction, not the camera’s. For such sprites, one way to
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset