PEXOCCSetBFReflectionModel - Set Back-Facing Surface Reflection Model (5.0)


Synopsis

 
    void PEXOCCSetBFReflectionModel(
         PEXOCC context,
         int model
     )
 

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

Arguments

context
An OC context returned by a successful PEXCreateOCCcall.

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 back-facing surface reflection model (PEXRMNone, PEXRMAmbient, PEXRMAmbientDiffuse or PEXRMAmbientDiffuseSpecular).

Returns

None.

Description

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

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

To apply the back-facing reflection model to the back-facing surfaces of output primitives, you must set the facet distinguish flag to True (see PEXOCCSetFacetDistinguishFlag). If you set the flag to False, then the implementation uses the reflection model when lighting back-facing surfaces (see PEXOCCSetReflectionModel).

PEXlib defines the following reflection models (model):

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

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

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

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

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:

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.