9.5.2

Table Of Contents
954 CHAPTER 18
TEXTURE MAPPING 955
Side (decal mapping)
Figure 1. Figure 2. Figure 3. Figure 4.
Suppose you project a texture onto a tube with Flat mapping. If you move the camera around to look
at the other side of the surface, you will still see the texture, but it will be the wrong way round. You
can solve this problem by using a decal — a material that is projected on one side of the surface only.
The direction of the surface normals for each polygon plays a pivotal role in deciding on which side
the texture is mapped. Front is in the direction of the surface normals and Back means in the opposite
direction to the surface normals (see Figure 1, above).
With Flat projection, a texture is projected from the front through to the back of an object. As a result,
the texture is also visible where it is not wanted in this case, on the front as well as on the back
of the tube (Figure 2). You can avoid such problems with decal mapping. Change Side from Both to
Front. Now render the tube again. This time the label is visible on the front side only (Figure 3). If the
viewing angle (i.e. the camera angle) and the surface normal form an angle of less than 90° to each
other, the polygon is a front polygon; otherwise, it is a back polygon (Figure 4).
The only exceptions are for Flat and Spatial mapping. Here there is an additional criterion: the direction
of the texture projection’s Z-axis. If the texture’s Z-axis points in the opposite direction to the surface
normal and if the viewing angle and surface normal form an angle of less than 90° to each other, the
polygon is a front polygon; otherwise, it is a back polygon.
Both
The texture is projected onto the front and back of each polygon, regardless of which mapping type
is selected.
Front
You will see the texture where the surface normals point towards the camera. Otherwise, the material
is invisible.
Back
You will see the texture only where the surface normals point in the opposite direction to the camera.
The material is otherwise invisible.