PEXOCCSetReflectionModel - Set Surface Reflection Model (5.0)


Synopsis

 
   void PEXOCCSetReflectionModel(
        PEXOCC context,
        int model
   )
 

 
   void PEXSetReflectionModel(
        Display *display,
        XID resource_id,
        PEXOCRequestType req_type,
        int model
   )
 

Arguments

context
An OC context returned by a successful PEXCreateOCC call.

display (OCC)
A pointer to a display structure returned by a successful XOpenDisplay call.

resource_id (OCC)
The resource identifier of the renderer or structure.

req_type (OCC)
The request type for the output command (PEXOCRender, PEXOCStore, PEXOCRenderSingle or PEXOCStoreSingle).

model
The surface reflection model (PEXRMNone, PEXRMAmbient, PEXRMAmbientDiffuse or PEXRMAmbientDiffuseSpecular).

Returns

None.

Description

Invoke PEXOCCSetReflectionModel to create an attribute output command which sets the surface reflection model attribute in the renderer's pipeline state according to the value specified by model.

By setting the surface reflection models attribute's ASF to PEXIndividual (see PEXOCCSetIndividualASF), you use the pipeline state's surface reflection model entry to specify which reflectance components to consider when performing reflectance calculations. When you set the surface reflection model attribute's ASF to PEXBundled, the implementation uses the surface reflection model from the interior bundle table.

If you do not set the facet distinguish flag to True (see PEXOCCSetFacetDistinguishFlag), then the implementation applies the specified surface reflection model to back-facing as well as front-facing surface interiors. Otherwise the implementation uses the back-facing surface reflection model (see PEXOCCSetBFReflectionModel).

PEX defines the following surface reflection models (model):

PEXRMNone -
performs no reflectance calculation. The surface color is not affected by light sources. (5.0)

PEXRMAmbient -
uses only the ambient terms of the reflectance calculation. (5.0)

PEXRMAmbientDiffuse -
uses only the ambient and diffuse terms of the reflectance calculation. (5.0)

PEXRMAmbientDiffuseSpecular -
uses the ambient, diffuse, and specular terms of the reflectance calculation. (5.0)

Note: The reflection models defined above simply have new names for PEXlib 5.2 and are completely equivalent to their respective names in PEXlib 5.1: PEXReflectionNone, PEXReflectionAmbient, PEXReflectionDiffuse, and PEXReflectionSpecular

If the implementation does not support the specified reflection model, then the model defaults to PEXRMNone. Inquire the supported values for the surface reflection model by invoking the PEXGetEnumTypeInfo function.

This function is a member of the general surface attribute set.

Errors

BadPEXRenderer
The specified renderer resource identifier is invalid.

BadPEXStructure
The specified structure resource identifier is invalid.

See Also

For an overview and for a list of output attribute functions, see Output Attribute Functions.