i
i
i
i
i
i
i
i
10.7. Particle Systems 459
scr tex
Figure 10.14. The angle of a screen pixel is computed as β
scr
=fov/screenres, and the
angle for the texture is computed similarly. Note that these are both approximations as
neither of the angles are constant for all pixels/texels.
polygon so its normal points directly to the viewer (see the image on the
right in Figure 10.13). This is therefore a viewpoint-oriented billboard.
Mapping the texture onto a polygon facing the viewer does not always
give a convincing effect. The problem is that an impostor itself does not
have a thickness, so can show problems when combined with real geometry.
See Figure 10.17 on page 463. Forsyth suggests instead projecting the
texture along the view direction onto the bounding box of the object [352].
This at least gives the impostor a little geometric presence.
The resolution of the texture need not exceed the screen resolution and
so can be computed by Equation 10.5 [1112].
texres = screenres
objsize
2 · distance ·tan(fov/2)
(10.5)
There are many ways in which an impostor may give a bad approximation of
the underlying geometry. This happens when some type of change in view
or object orientation becomes larger than some threshold, and the impostor
is then said to be invalid. One limit to the usefulness of an impostor is its
resolution. If a distant impostor comes closer, the individual pixels of the
texture may become obvious, and so the illusion breaks down. The angles
β
scr
, which represents the angle of a pixel, and β
tex
, which represents the
angle of a texel of the impostor, can be used to determine when the lifetime
of an impostor has expired. This is illustrated in Figure 10.14. When
β
tex
scr
, there is a possibility that the texels will be clearly visible,
requiring the impostor to be regenerated from the current position of both
the viewer and the object. In this way, the impostor texture adapts to the
screen resolution.
We must also test whether the impostors are valid from the current
point of view. Here we present Schaufler’s method [1112, 1113]. The first
observation is that when only the view direction changes, the impostors
need not be updated. The reason is that even though the projection plane
i
i
i
i
i
i
i
i
460 10. Image-Based Effects
Figure 10.15. The left part illustrates the overestimate of the error angle β
trans
,andthe
right part shows the overestimate of β
size
. When any of these angles becomes greater
than β
scr
, the impostor needs to be regenerated. The bounding box of the original object
is shown in blue. (Illustration after Schaufler [1112].)
changes as the viewer rotates, the projection itself does not. A viewpoint-
oriented billboard always directly faces the viewer, regardless of the view
direction.
We need to consider regenerating an impostor only when the viewer
moves relative to the impostor. We will look at the two extreme cases,
which are shown in Figure 10.15. The left case in this figure shows how
to compute an error angle called β
trans
that increases as the viewer moves
sideways (parallel to the plane of the impostor). The apparent displacement
of the object from two such viewpoints is called the parallax. The error
angle is computed by considering how the extreme points on the object’s
original bounding box create an angle when the viewer moves. When the
viewer has moved sufficiently far, the impostor will need to be updated
because β
trans
scr
.
The right case in Figure 10.15 shows the extreme case when the viewer
moves toward the impostor. This angle is computed by considering how
extreme points on the bounding box project onto the impostor plane when
the viewer moves toward the impostor. Both angles β
trans
and β
size
can
be computed with, for example, the law of cosines (see Section B.2). This
is a different test than that for β
tex
, as it measures the amount of change
in perspective effect. In conclusion, an impostor needs to be regenerated
every time β
tex
, β
trans
,orβ
size
is greater than β
scr
.
Forsyth [352] gives many practical techniques for using impostors in
games. He suggests that some heuristic be used to update the texture coor-
dinates (on more complex shapes containing the object) to reduce parallax
errors. Also, when impostors are used for dynamic objects, he suggests a
preprocessing technique that determines the largest distance, d,anyvertex
moves during the entire animation. This distance is divided by the number
i
i
i
i
i
i
i
i
10.7. Particle Systems 461
of time steps in the animation, so that Δ = d/frames. If an impostor has
been used for n frames without updating, then Δ n is projected onto the
image plane. If this distance is larger than a threshold set by the user,
the impostor is updated. Other ideas include updating the objects close to
the near plane or the mouse cursor more often. For efficient updating of
impostors, he suggests rendering a number of them to subregions of a large
texture.
Forsyth also uses prediction in an interesting way. Normally, an impos-
tor is created for a certain frame, and it is only correct for that frame. A
number of frames later, the impostor is updated again. If some prediction
of camera and animation parameters can be done for the frame in between
these generation times, then the average quality of the impostor can be
improved. However, using impostors for dynamic objects, especially un-
predictable ones such as players, is hard. For small objects, such as distant
people in crowd scenes, it is possible to store a set of impostors for a wide
range of views and in different animated poses using a set of textures. How-
ever, the costs can be high, e.g., 1.5 Mb per figure [266]. Often it is best to
just render the geometry when an object moves, and switch to impostors
when the object is static [352]. Kavan et al. [637] introduce polypostors,
in which a model of a person is represented by a set of impostors, one for
each limb and the trunk. This system tries to strike a balance between
pure impostors and pure geometry.
A major advantage of impostors is that they can be used to improve
frame rate, sometimes at a reduction in quality. Schaufler [1114] de-
scribes a constant-frame-rate algorithm for impostors, which is similar to
Funkhouser and S´equin’s work [371] presented in Section 14.7.3. Rafferty
et al. [1043] present a technique that replaces the geometry seen through
a portal with an impostor. They also use image warping to give longer
lifetimes to the impostors, as does Schaufler [1116].
Hierarchical image caching is an algorithm that uses impostors arranged
in a hierarchy for better performance. This technique was invented inde-
pendently by Schaufler and St¨urzlinger [1113] and Shade et al. [1151]. The
basic idea is to partition the scene into a hierarchy of boxes and create
an impostor for each box, and also to create impostors for the parents in
the partitioning. The impostors are then updated hierarchically. A related
area of study, point-based rendering, represent surfaces with a hierarchical
arrangements of splats, essentially alpha-blended particles; see Section 14.9.
Meyer et al. [862] use a hierarchy of bidirectional texture functions
(BTF) to render trees realistically. A BTF is a texture that stores, for
each texel, shaded colors for multiple lighting and viewing directions. An-
other way of thinking about a BTF is as a series of images of an object or
surface, one for each combination of viewing and lighting direction. Several
such images, evenly located on a sphere, are thus used in a hierarchy to
i
i
i
i
i
i
i
i
462 10. Image-Based Effects
represent the tree. Nine BTFs are combined to reconstruct the tree for
a particular view and light direction. At rendering time, they also use a
hierarchy of cube maps to compute shadows on the trees.
10.7.2 Billboard Clouds
A problem with impostors is that the rendered image must continue to face
the viewer. If the distant object is changing its orientation, the impostor
must be recomputed. To model distant objects that are more like the
triangle meshes they represent, ecoret et al. [241] present the idea of a
billboard cloud. A complex model can often be represented by a small
collection of overlapping cutout billboards. A real-world analog is a paper
cut-out model. Billboard clouds can be considerably more convincing that
paper models, as additional information, such as normal or displacement
maps and different materials, can be applied to their surfaces. Cracks
are handled by projecting polygons along the crack onto both billboards.
ecoret et al. present a method of automatically finding and fitting planes
to a given model within some given error tolerance.
This idea of finding a set of planes is more general than the paper cut-
out analogy might imply. Billboards can intersect, and cutouts can be
arbitrarily complex. For example, a number of researchers fit billboards to
polygonal tree models [80, 373, 376, 707]. From models with tens of thou-
sands of triangles, they can create convincing billboard clouds consisting
of less than a hundred textured quadrilaterals. See Figure 10.16. That
said, using billboard clouds can cause a considerable amount of overdraw,
costing fill rate, so it is expensive in other ways. Semitransparent pixels
can also cause visible problems in some situations if the billboards (and
separate objects) are not properly drawn in back-to-front order (for trees,
such problems are usually lost in the noise).
Figure 10.16. On the left, a tree model made of 20,610 triangles. In the middle, the tree
modeled with 78 billboards. The overlapping billboards are shown on the right. (Images
courtesy of Dylan Lacewell, University of Utah.)
i
i
i
i
i
i
i
i
10.8. Displacement Techniques 463
Figure 10.17. The upper left image shows a simple scene rendered with geometry. The
upper right image shows what happens if impostors are created and used for the cube,
the cylinder, and the cone. The bottom image shows the result when depth sprites are
used. The depth sprite in the left image uses two bits for depth deviation, while the one
on the right uses eight bits. (Images courtesy of Gernot Schaufler.)
10.8 Displacement Techniques
If the texture of an impostor is augmented with a depth component, this
defines a rendering primitive called a depth sprite or a nailboard [1115]. The
texture image is thus an RGB image augmented with a Δ parameter for
each pixel, forming an RGBΔ texture. The Δ stores the deviation from
the depth sprite polygon to the correct depth of the geometry that the
depth sprite represents. This Δ channel is essentially a heightfield in view
space. Because depth sprites contain depth information, they are superior
to impostors in that they can help avoid visibility problems. This is espe-
cially evident when the depth sprite polygon penetrates nearby geometry.
Such a case is shown in Figure 10.17. If basic impostors were used, closely
located objects would have to be grouped together and treated as one to
get a reasonable result [1115].
When a depth sprite is rendered, the depth of the depth sprite polygon
is used as an offset for the Δ-values. Since depth-difference values are
stored in the Δ-components, a small number of bits can be used to store
..................Content has been hidden....................

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