i
i
i
i
i
i
i
i
10.6. Billboarding 449
Figure 10.5. A view of four spheres, with a wide field of view. The upper left is a
billboard texture of a sphere, using view plane alignment. The upper right billboard is
viewpoint oriented. The lower row shows two real spheres.
render these is by using this world up vector to derive the rotation matrix.
In this case, the normal is still the negation of the view plane normal,
which is the fixed vector, and a new perpendicular up vector is derived
from the world’s up vector, as explained previously. As with screen-aligned
billboards, this matrix can be reused for all sprites, since these vectors do
not change within the rendered scene.
Using the same rotation matrix for all sprites carries a risk. Because of
the nature of perspective projection, objects that are away from the view
axis are warped. This projection warps objects that are away from the view
direction axis. See the bottom two spheres in Figure 10.5. The spheres
become elliptical, due to projection onto a plane. This phenomenon is not
an error and looks fine if a viewer’s eyes are the proper distance and location
from the screen. That is, if the virtual camera’s field of view matches the
eye’s actual field of view, then these spheres look unwarped. We usually
notice this warping because the real viewing conditions are rarely exactly
those portrayed in the two-dimensional image.
3
For example, the field of
3
For centuries, artists have realized this problem and compensated as necessary. Ob-
i
i
i
i
i
i
i
i
450 10. Image-Based Effects
Figure 10.6. A top view of the two billboard alignment techniques. The five billboards
face differently, depending on the method.
view is often made wider than expected viewing conditions, so that more
of the surrounding scene is presented to the user (see Section 4.6.2).
When the field of view and the sprites are small, this warping effect can
often be ignored and a single orientation aligned to the view plane used.
Otherwise, the desired normal needs to equal the vector from the center
of the billboard to the viewer’s position. This we call a viewpoint-oriented
billboard. See Figure 10.6. The effect of using different alignments is
shown in Figure 10.5. As can be seen, view plane alignment has the effect
of making the billboard have no distortion, regardless of where it is on
the screen. Viewpoint orientation distorts the sphere image in the same
way in which real spheres are distorted by projecting the scene onto the
plane. For impostors, discussed in Section 10.7.1, viewpoint orientation is
normally more appropriate. Impostors are meant to simulate geometry in
a scene, so the simulation should distort in the same way as real geometry
does.
World-oriented billboarding is useful for rendering many different phe-
nomena. Guymon [471] and Nguyen [928] both discuss in depth making
convincing flames, smoke, and explosions. One technique is to cluster and
overlap animated sprites in a random and chaotic fashion. Doing so helps
hide the looping pattern of the animated sequences, while also avoiding
making each fire or explosion look the same. Reis [1061] gives a fast method
for also approximating the light-scattering properties of smoke, using im-
postors and relief mapping techniques to achieve more convincing results.
For animating billboards, it is beneficial to store all of the animated
frames in the same texture. This reduces the overhead associated with
changing textures. One way of doing so is to use a volume texture to store
the animation, with the z-axis essentially acting as time. By changing the
z-axis to a value between two layers, a blend frame between two images
can be generated. One drawback to this method is that mipmapping will
jects expected to be round, such as the moon, were painted as circular, regardless of
their positions on the canvas [477].
i
i
i
i
i
i
i
i
10.6. Billboarding 451
Figure 10.7. Clouds created by a set of world-oriented impostors. (Images courtesy of
Mark Harris, UNC-Chapel Hill.)
i
i
i
i
i
i
i
i
452 10. Image-Based Effects
cause averaging of adjacent frames. Texture arrays (supported by DirectX
10-level hardware) address this problem, although they require two texture
lookups to blend between frames. For GPUs without support for texture
arrays, a commonly used alternative is to pack the animation frames into
a two-dimensional texture as a grid of images.
Dobashi et al. [264] simulate clouds and render them with billboards,
and create shafts of light by rendering concentric semitransparent shells.
Harris and Lastra [505] also use impostors to simulate clouds. See Fig-
ure 10.7. They treat the clouds as three-dimensional objects, in that if a
plane is seen flying into a cloud, the impostor is split into two pieces, one
behind the plane and one in front. It is worth noting that the world up vec-
tor is just one choice for defining an impostor’s orientation. For example,
Harris and Lastra use the up vector of the view used to create the impostor
originally. Consistency is maintained as long as the same up vector is used
frame to frame to orient the impostor.
Wang [1319, 1320] details cloud modeling and rendering techniques used
in Microsoft’s flight simulator product. Each cloud is formed from 5 to 400
billboards. Only 16 different base sprite textures are needed, as these can
be modified using non-uniform scaling and rotation to form a wide variety
of cloud types. Modifying transparency based on distance from the cloud
center is used to simulate cloud formation and dissipation. To save on pro-
cessing, distant clouds are all rendered to a set of eight panorama textures
surrounding the scene, similar to a skybox. The artist sets a number of
parameters to control shading. For example, there are five different cloud
height color levels. The effect of dissipation of light in heavy clouds is
approximated by making the lower altitudes darker. The artist also sets
colors associated with different sun directions. These determine how clouds
look at midday versus sunset.
Billboards are not the only cloud rendering technique possible. For
example, Elinas and Stuerzlinger [304] generate clouds using Gardner’s
method of rendering sets of nested ellipsoids that become more transpar-
ent around the viewing silhouettes. Pallister [985] discusses procedurally
generating cloud images and animating these across an overhead sky mesh.
Wenzel [1342] uses a series of planes above the viewer for distant clouds.
As discussed in Sections 5.7 and 6.6, overlapping semitransparent bill-
boards should be rendered in sorted order, usually with z-depth testing
on but writing off for semitransparent fragments, to perform compositing
correctly. Smoke or fog billboards cause artifacts when they intersect solid
objects. See Figure 10.8. The illusion is broken, as what should be a vol-
ume is seen to be a set of layers. One solution is to have the pixel shader
program check the z-depth of the underlying objects while processing each
billboard. If the underlying object is close to the billboard’s depth at a
pixel, then the transparency of the billboard fragment is increased. In this
i
i
i
i
i
i
i
i
10.6. Billboarding 453
Figure 10.8. On the left, the areas circled show where intersection artifacts occur due
to the dust cloud billboards intersecting with objects. On the right, the billboards fade
out where they are near objects, avoiding this problem. (Images from NVIDIA SDK
10 [945] sample “Soft Particles” courtesy of NVIDIA Corporation.)
way, the billboard is treated more like a volume and the layer artifact dis-
appears. Fading linearly with depth can lead to a discontinuity when the
maximum fade distance is reached. An S-curve fadeout function avoids this
problem. Lorach [792, 945] provides more information and implementation
details. Billboards that have their z-depths modified in this way are called
soft particles.
Fadeout using soft particles solves the problem of billboards intersecting
solid objects. Another problem can occur when explosions move through
scenes or the viewer moves through clouds. In the former case, a billboard
could move in front of an object during an animation. This causes a no-
ticeable pop if the billboard moves from entirely invisible to fully visible.
Similarly, as the viewer moves through billboards, a billboard can entirely
disappear as it moves in front of the near plane, causing a sudden jump in
what is seen. Umenhoffer et al. [1280, 1281] introduce the idea of spher-
ical billboards. Essentially, the billboard object is thought of as actually
defining a spherical volume in space. The billboard itself is rendered ig-
noring z-depth read; the purpose of the billboard is purely to make the
pixel shader program execute at locations where the sphere is likely to be.
The pixel shader program computes entrance and exit locations on this
spherical volume and uses solid objects to change the exit depth as needed
and the near clip plane to change the entrance depth. In this way, each
billboard’s sphere can be properly faded out.
A slightly different technique was used in Crysis [887, 1341], using box-
shaped volumes instead of spheres to reduce pixel shader cost. Another
..................Content has been hidden....................

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