Java Reference
In-Depth Information
Figure 5. Using the same texture but having different texture attributes
Under the BLEND mode, the color in the texture image can be seen to blend in with
that of the geometry, with the former determining the amount of the non-texture color that
will be added. The resulting transparency is the combination of the texture and material
transparency. In addition, a blend color can also be supplied to result in a pixel color that
is a combination of the texel and the blend color. By default, the blend color is black with
an alpha value of 0.
When the texture mode is changed to MODULATE, the texture color is combined with
the non-texture color in a modulating manner in the same way a signal modulates a carrier.
The resulting transparency is also the sum of those due to the texture and material. Since
the BLEND and MODULATE modes give rise to colors that depend on both the non-texture
and the texture colors, they are useful for applying the same texture to different objects
without having them giving the same look.
Lastly, in the DECAL mode, the texture color is applied as a decal on top of the non-
texture color, and the transparency of the texture determines the amount of material color
that will be applied, with the transparency of the pixel remaining unchanged. This mode
requires a texture format of RGB or RGBA.
Since the mapping of textures to geometry takes place in image space, there may be
a need to carry out perspective correction to have the rendered textured surface looks as
realistically as possible in a 3D world. However, this will consume computational resources.
Two options, FASTEST and NICEST, are thus provided for the programmer to choose in
performing this correction.
Lastly, it is also possible to use a map transform for a texture to change, say the ori-
entation of the texture image, before it is used for rendering. Figure 7 illustrates how this
can be done to result in a 90-degree rotation of the rendered result when compared with
those in Figure 6.
Search WWH ::

Custom Search