RwSetPolygonMaterialModes(RwPolygon3d
*polygon,
RwMaterialModes modes);
Description
Sets the Material modes of a polygons material. Material modes permit fine grain control over the rendering of Materials.
Arguments
polygon Pointer to the polygon.
modes A bitfield representing a Material mode (or "bitwise or" of modes).
Return Value
The argument polygon if successful, and NULL otherwise.
Comments
The following material modes are supported:
rwDOUBLE The material will be rendered double sided.
For further information see the Material Modes section in Chapter 2: Data Types.
Unlike RwAddMaterialModeToPolygon(), which simply adds one or more Material modes to a polygons materials set of modes, RwSetPolygonMaterialModes() replaces a polygons materials entire set of modes with those specified.
RenderWare optimizes memory usage by sharing materials across multiple polygons. Setting a polygon material property with this function will cause the polygon to have its own copy of the material, not shared by any other polygons. Unless this is the desired effect, it is more memory efficient to use the corresponding material function RwSetMaterialModes() to change the underlying polygon material. This change will then be propagated to all polygons which use the material. The following line of code demonstrates how this is achieved:
RwSetMaterialModes(RwGetPolygonMaterial(polygon),
modes);
See Also