The Texture class can be used to define how texture will be rendered if the texture
coordinates used have values which are not quite consistent or beyond the 0 to 1 normal-
ized values for the entire texture image space. Specifically, the following possibilities are
Boundarymode: WRAP or CLAMP. Boundary mode is on the rendering of texture
when the texture coordinates are outside the image space. The default WRAP option
specifies that the texture will be repeated to cover the entire surface. CLAMP uses
the color at the edge of the image and stretches it across the remaining part of the
uncovered surface. Specification of the boundary mode can be made for each of the
horizontal and vertical dimensions of the image independently.
Filtering: This is on how texture will be rendered when a displayed pixel is smaller
or larger than a texel or the pixel for the texture image. A magnification filter can be
specified for the former, while a minification filter can be defined for the latter.
Boundarycolor: Allows a single color to be used outside the 0 to 1 range of the
image space, that is, in the boundary region. This is applicable only if the boundary
mode is CLAMP and the texture coordinates are beyond the 0 to 1 range.
Textureformat: Speciies the number of color bits and the color format for each
texel and how these will affect the pixels on which they are rendered on. For example,
using RGBA means that each texel will have 32-bit color value, and that the pixel
color and alpha values will be modified by the corresponding texel.
Together with the Texture class, the TextureAttributes class provides the programmer with
even greater control on the rendering of texture (Bouvier, 2006). In particular, as illustrated
in Figure 5, it opens up the possibility for a texture to be shared by different geometries
and yet for it to be customized based on having different texturing attributes.
Under texture attributes, it is possible to specify the texture mode, the blend color, the
perspective correction, and the texture map transform to be used. In particular, the texture
mode is on how the colors in the texture image will blend in with those from the object.
Figure 6 shows an example illustrating the effect of having different texture modes.
In lines 4 to 5 of the code segment, the object is set to have a color of green. Also, line
2 specifies the texture mode and this is set to BLEND in the code segment. The texture
image is a deck. This is the same as the third result, or when the texture mode is changed
to REPLACE, the default mode signifying that the texture color will be used to replace
the object color. Under this mode, the texture image will be used to provide the color and
transparency for the final pixel, and all, except specular color with lighting enabled, will
Search WWH ::