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