Game Development Reference
Figure 14.18 Representation of the earth using textures
then be projected on the screen. To know the colour of a point on the screen, it is thus
enough to know the geometric transformation that makes it possible to pass from the
plane of the texture to a point of the surface. This function is what we call the texture
coordinates. Then, only an algorithm for texture mapping remains to be determined.
The texture mapping techniques change with the surface taking the texture.
Ideally, texture mapping consists of finding an isomorphism between an image (plane
surface defined by coordinates ( u , v )
[0, 1] 2 ) and any surface defined by a function
f ( x , y , z )
0. A double interpolation is generally sufficient for plane surfaces. This
isomorphism clearly does not exist for all types of surfaces. Texturing of a sphere (for
example, to represent the earth) is impossible by simple interpolation algorithms.
188.8.131.52 Advantages and disadvantages of textures
Using textures makes it possible to reduce the number of polygons required to represent
an object. Let's re-use the example of the earthmentioned earlier. If we create this object
without using a texture, with the number of polygons required to represent the nature
of the ground (land, water) plus the polygons for clouds, modelling the earth will
become more tedious and will require a huge number of polygons. Here, some satellite
pictures and a sphere (decimated into several hundred triangles) were sufficient for
creating the image given in figure 14.18.
The latest 3D graphics cards also have pre-wired 3D display algorithms and 3D
object texturing functions. The images used as textures are stored in a special memory
called the texture memory embedded in the graphics card. Access to this memory
is thus much faster than to the central memory and a special processor takes care
of texture mapping, taking a large load off the main processor. However, the textures
naturally have an inferior display quality (in the previous example, the perception does
not improve even if we go close to the earth). Using graphics cards with specialised
memory is a relatively expensive technique since the memory used has extremely low
response time: it is thus generally available in limited quantity.