RenderWare V2.1

Previous Page Index Next Page

RwRaster *

RwReadMaskRaster(char *filename);

Description

Reads a mask raster from the specified file. The resulting raster can be applied to a texture as a mask.

Arguments

filename Name of the mask raster file.

Return Value

A pointer to the new mask raster if successful, and NULL otherwise.

Comments

The raster read by RwReadMaskRaster() is used to mask a texture. Those pixels which are "masked out" by the raster are not rendered. Thus, a mask raster is effectively a one bit alpha channel which, when applied to a texture, gives control over the transparency of individual pixels.

The raster read by RwReadMaskRaster() is converted to the texture map dimensions of 128 pixels in width by 128 pixels in height (or n * 128 pixels for a multi-frame texture where n is the number of frames in the texture). Furthermore, the image read will be converted to the current RenderWare render depth.

The file read by this operation should contain a gray scale image of any supported depth. The gray scale value of each pixel is simply thresholded to determine whether it represents an opaque or transparent pixel. Pixels whose value is less than half of the available range of gray values represent transparent pixels. Those whose value is greater than or equal to half the available range of gray values represent opaque pixels.

If filename is not a full path, the library searches for the specified file in all directories on its shape path.

See Also

RwBitmapRaster()

RwCreateRaster()

RwCreateTexture()

RwDestroyRaster()

RwDuplicateRaster()

RwGetShapePath()

RwMaskTexture()

RwSetCameraBackdrop()

RwSetShapePath()

RwSetTextureRaster()