1. Field of the Invention
The invention generally relates to computer graphics, and more particularly relates to computer graphics illumination modeling.
2. Background of the Invention
In recent years, advances in computer technology have fueled an explosive growth in the field of computer graphics. The rendering of two dimensional (2D) and three dimensional (3D) objects have become dramatically more realistic as demonstrated by computer-generated commercials and movie special effects. As such, the task of generating computer graphics, which may include complex three-dimensional objects with full color, shading, texture mapping, and transparency blending, is a complex one that involves processing huge amounts of graphical data. Demands for even more sophisticated graphics capabilities with more realism to be delivered at a faster rate result in a need for continuous improvements in software and hardware implementations.
In generating a computer geometric model of an object, parametric surface patches are connected together to form the desired graphics object. Each parametric surface patches are further subdivided into smaller and plainer elements. These smaller and plainer elements are called primitives. A primitive can be any solid or patterned shape such as polygons, spheres, cylinders, free-form surfaces, etc. Most commonly, primitives are triangles. Since each graphics primitive in the geometrical model is represented by a data structure, the geometrical model is a linked data structure stored in computer memory. Each graphics primitive in the geometrical model is, in turn, associated with the proper attributes to give it the desired color, shade, texture, and transparency. For this reason, attributes are necessary to make computer graphics more realistic,
Texture mapping is a well-known technique used to apply these attributes to the geometric model to make the computer graphics generated more realistic. Texture mapping is particularly useful and efficient when the detail is fine and intricate. In texture mapping, a digitized image (a.k.a. texture map) having individual elements, which are often called texels, depicting the detail is mapped onto a surface. Generally, texture mapping can be accomplished in two steps. First, the four corners of the pixel on the monitor screen is mapped onto the surface's coordinate space (u,v). Next, the pixel's corner points in the surface's coordinate space (u,v) are mapped into the texture's coordinate space (s,t). A value for the pixel is computed by summing all texels within the quadrilateral defined by the four (s,t) points in the texture map.
However, texture mapping is not effective in depicting a rough and/or uneven surface (e.g., a stone, a brick, etc.). If the texture map is a photograph of a rough and/or uneven surface, the surface that is texture mapped will continue to appear geometrically smooth. Due to the unevenness of the rough surface, the direction to the light source used to create the texture map is typically different from the direction to the light source illuminating the surface that is texture mapped. Accordingly, unless such directional differences are minimized or compensated, the shadows that are necessary in depicting changing depths associated the peaks and valleys in a bumpy surface are not produced. Hence, the surface that is texture mapped continues to appear smooth.
One way to depict a rough and/or uneven surface is to geometrically model every surface bump and defect. To do so may, however, takes hours in time. To provide the appearance of a bumpy surface without requiring geometric modeling, bump mapping was developed. Bump mapping involves adjusting the surface normal vector to reflect the unevenness in a surface, before it is used in the illumination model. Accordingly, a bump map is an array of displacements, each of which can be used to stimulate displacing a point on a surface a little above or below that point's actual position. A good approximation to the new (unnormalized) normal N' that is then substituted for the surface normal in the illumination equation is: ##EQU1## where N is the old normal, .vertline.N.vertline. is the magnitude of vector N, A.sub.s and A.sub.t are partial derivatives of a point on the surface represented by vector A=[x(s,t), y(s,t), z(s,t)], and B.sub.u and B.sub.v are the partial derivatives of the selected bump map entry B with respect to the bump-map parameterization axes, u and v. For a discussion of texture mapping, bump mapping, and illumination equations, refer to James D. Foley et al., "Computer Graphics" (2d ed. 1996) which is herein incorporated by reference.
Although, bump mapping is capable of creating realistic bumpy textured computer graphics, it is also undesirable for a number of reasons. Due to the number of calculations required for each point on the surface, bump mapping is also a rather slow process. Given the current technology, the texture of one image may take many seconds or even minutes to process under bump mapping. Furthermore, bump mapping may not exhibit areas of the surface shadowed by the bumps which tend to decrease the realism of the computer-generated graphics.
Thus, a need exists for a more expeditious technique to create realistic bumpy self-shadowed textured computer graphics.