Graphics Reference
In-Depth Information
Figure 16.25. Fog, without (left) and with (right) noise.
Morphing 3D Geometry
Ever since the movie Willow (1988), morphing 3D geometry has been a main-
stream topic in computer graphics. It would be fun to use shaders to do this
in a general way. Unfortunately, morphing one general 3D object to another
general 3D object is quite difficult because you need to create a careful corre-
spondence between both sets of vertices, which is hard to do in an automated
way. However, we can morph between two known shapes, such as a sphere to
a disk, as shown in Figure 16.26. As we are altering vertex coordinates, most
of the work is done by the vertex shader, shown here. The object is originally
defined as a sphere, but its texture coordinates ( aTexCoord0.st ) are used to
Figure 16.26. Morphing between a sphere and a disk. From left to right, uBlend is 0.0, 0.5, and 1.0.
Search WWH ::




Custom Search