PEXOCCSetBFReflectionAttributes - Set Back-Facing Surface Reflection Attributes (5.0)


Synopsis

 
     void PEXOCCSetBFReflectionAttributes(
          PEXOCC context,
          PEXReflectionAttributes5_2 *attributes
     )
 

 
     void PEXSetBFReflectionAttributes(
          Display *display,
          XID resource_id,
          PEXOCRequestType req_type,
          PEXReflectionAttributes *attributes
     )
 

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).

attributes
The back-facing surface reflection attributes.

Returns

None.

Description

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

By setting the back-facing reflection attribute's ASF to PEXIndividual (see PEXOCCSetIndividualASF), you use the pipeline state's back-facing surface reflection attributes entry to define the reflection calculation used to light the back-facing surfaces of output primitives. When you set the back-facing reflection attribute's ASF to PEXBundled, the implementation uses the back-facing reflection attributes values from the interior bundle table.

To apply the back-facing reflection attributes 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 attributes when rendering back-facing surfaces (see PEXOCCSetReflectionAttributes).

The attributes argument defines surface reflection attributes that include ambient, diffuse and specular coefficients, the specular concentration and color, and the transmission coefficient. The ambient, diffuse, and specular coefficients define the fraction of ambient, diffuse, and specular light respectively reflected by a back-facing surface. Specify a value of 0.0 to reflect no light. Specify a value of 1.0 to reflect 100% of the light.

The larger the value of the specular concentration value of the back-facing reflection attributes, the shinier the back-facing surface. If the implementation does not support the specified color type, then the implementation uses a back-facing specular color type of PEXColorTypeIndexed with a value of one. For out of range direct color components, the result is implementation-dependent. If you specify an indexed color with an index of 65535, then the implementation issues a BadPEXOutputCommand error.

Inquire whether the transmission coefficient is used in the reflection calculation by inquiring the transparency supported via the PEXGetImpDepConstants function. (See also Transparency Methods). The transmission coefficient defines the default alpha component of back-facing surface primitives without an explicit alpha-component. Specify a transmission coefficient of 0.0 for an opaque surface. Specify a value of 1.0 for a transparent surface. The alpha-component value is determined by subtracting the transmission coefficient from 1.

The back-facing surface reflection attribute is a member of the general surface attribute set.

Errors

BadPEXOutputCommand
The specified color index is 65535.

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 all output attribute functions, see Output Attribute Functions.