Graphics Reference
In-Depth Information
12.3
File Texture Mapping
File texture mapping. In
this topic, we use the terms
file texture mapping and tex-
ture mapping interchangeably.
While this is acceptable in our
context, be aware that there
are many forms of mapping or
calculating texture on primi-
tives. For example, procedu-
ral texture mapping computes
textures with no reference to
files.
As illustrated in Figure 12.10, one way to understand file texture mapping is that
we stretch/compress an image from a file and paste this image like a label onto
a primitive. The main goal of texture mapping is to increase the apparent com-
plexity of a scene. For example, Figure 12.11 is a simple scene with a circle
and a rectangle. Figure 12.12 shows the same scene with the same simple circle
and rectangle primitives except that in this case both primitives are pasted (or
mapped) with file textures. When we compare these two images, the image from
Figure 12.12 appears to be more complex. For many interactive applications,
appropriately texture-mapped primitives can lead to significantly more appealing
application and can contribute directly to positive user experience.
For the case of Figure 12.10, we refer to the images as texture maps and de-
scribe the primitives as texture-mapped primitives. Just like a pixel is the basic
element in an image, we refer to each element of a texture map as a texel. In all of
the examples we will work with, texel values are colors. However, in general, a
texel can contain any arbitrary floating-point value. To understand the basic con-
cepts behind file texture mapping, in the following discussion we will first clarify
what a texture file is. We then explain the two coordinate systems that enable
the mapping process. The actual texture lookup and pixel color computation are
presented last.
Figure 12.11. Asim-
ple scene of a circle and a
square.
12.3.1
File Texture: Image Files
As depicted in Figure 12.10, the rectangular photograph on the lower-left corner
of Figure 12.12 is actually a simple rectangle primitive pasted with an image. In
this case, the image happens to be a digital photograph stored in the jpeg format.
png image
paste on
geometry
Figure 12.12. Simple
scene with texture maps.
texture
map
paste on
geometry
jpg image
Figure 12.10.
Pasting images on primitives.
Search WWH ::




Custom Search