RenderWare V2.1

Previous Page Index Next Page

RwPolygon3d *

RwSetPolygonLightSampling(RwPolygon3d *polygon, RwLightSampling type);

Description

Sets the light sampling type of the polygon’s material.

Arguments

polygon Pointer to the polygon.

type The light sampling type.

Return Value

The argument polygon if successful, and NULL otherwise.

Comments

The light sampling types are:

• rwFACET Flat shading.

• rwVERTEX Smooth shading.

RenderWare optimizes memory usage by sharing materials across multiple polygons. Setting a polygon material property with this function will cause the polygon to have it’s 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 RwSetMaterialLightSampling() 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:

RwSetMaterialLightSampling(
RwGetPolygonMaterial(polygon), type);

See Also

RwGetPolygonLightSampling()

RwSetMaterialLightSampling()

RwSetPolygonGeometrySampling()

RwSetSurfaceLightSampling()