Introduction and Background
One of the most important problems in computer graphics is making shapes on a screen appear to be realistic, physical objects. Once we have approximated their geometry, the next step is to ensure that their surfaces show patterns of color like those of the physical material that the objects are supposed to represent. This is the motivation for texture mapping and procedural texturing.
The simplest form of texturing is texture mapping, which as the name suggests maps points from the object's space to a texture space. The texture space is usually created from an image file, often a photograph or artist's rendering of the material, thus the texture space is a rectangle with evenly spaced points where the value is the color of the image at that pixel, and the color of the point in object space is obtained by interpolating between the point color values.
This technique works fairly well, but has several limitations.
One problem is that if the object (or one polygon of the object, if the texture is being mapped onto the object per-face) takes up more pixels on screen than are present in the image file, the lower resolution of the texture shows up clearly in the rendered image, decreasing the realism. In fact, the sampling problems inherent in a limited-resolution image will often be displayed or magnified when those samples are further distorted by additional transformations.
The difference in resolutions can sometimes be dampened by having a texture repeated over the surface. However, this presents a different problem in that if the texture is repeated enough times, the pattern will be noticeable to the viewer, and a perfectly even pattern is unacceptable for surfaces that should vary over space. Additionally, it is a nontrivial problem to create an image whose edges match up so that when repeated, no seam is visible.
The files containing the image files, also, can get very large very quickly as one attempts to combat the resolution problem by supplying more data from which to interpolate. This entails a cost both in storage space and in memory, as most or all of the image will be loaded into memory at any given time.
One more issue is that the mapping function itself can get complicated and expensive. It is surprisingly expensive simply to map one quadrilateral in three dimensions onto another, and for implicit surfaces and other geometries it only gets worse.
There are also cases where different textures would be needed based on the nature of the material being represented. The canonical example is that of wood, where a face of a block of wood that is perpendicular to the grain of the wood is very different from a face that is parallel.
Procedural texturing, and procedural solid texturing, are techniques that address many of these problems.
The essential idea of procedural solid texturing is that the color of a pixel is based functionally on the point's xyz coordinates. For example, instead of using a picture of wood grain, the renderer can calculate the grain and ring patterns based on the properties of wood. This defeats most of the problems mentioned above:
Besides solid texturing, this technique can be used in conjunction with texture mapping for 2d textures; the mapping transformation must still be solved, but the memory and resolution advantages persist. These exact techniques can also be used to create values for, besides color, the normal to a surface, transparency, specular reflectivity, or even displacement.
One useful variant on procedural texturing is bombing, in which features are added to the texture in random locations. For example, polka dots could be added in random places on the surface of a beach ball. This can be difficult to do implicitly, where by implicitly we mean being able to tell the color of a pixel knowing only the pixel's information and nothing about the pixels around it. This is one of the issues addressed in our procedural texturing toolbox.