|
Tutorial: Image and Pixel Textures

For an ImageTexture, the url field contains the name of the image files
to be used for the texture, in order of preference. The coordinates for the
texture are in (s, t), where each of the coordinates is between 0 and 1.
The repeatS and repeatT fields of the node determine how the texture is repeated.
In each of the illustrations the texture coordinates are set at
(0, 0), (4, 0), (4, 4), (0, 4). In the first case repeatS and repeatT are both true.
This means that the image is repeated 4 times in each direction.

In this case, repeatS is true but repeatT is false. As a result, the texture
is repeated 4 times horizontally. The texture is not repeated vertically,
in the t direction. The top line of the texture, however, is extended up
to the top of the rectangle.

In this case, repeatS is false but repeatT is true. Now, the texture is
repeated vertically but not horizontally. The right edge is extended toward
to the right edge of the rectangle.

In a PixelTexture, instead of specifiying an image file, the image data
is placed directly in the image field. The image has a width, a height,
and a number of components. The number of components is 1, 2, 3 or 4.
If there are 3 components, they are in RGB color format. The fourth component
is the alpha component.

The repeatS and repeatT fields for the PixelTexture behave in exactly the
same way as the fields in an ImageTexture.

If the number of components is 1 or 2. The image data specifies intensity.
In this example, the diffuseColor of the Material node is set to green.
The texture then varies the intensity of the green.
|