PEXOCCSetReflectionAttributes - Set Surface Reflection Attributes (5.0)


Synopsis

 
   void PEXOCCSetReflectionAttributes(
        PEXOCC context,
        PEXReflectionAttributes5_2 *attributes
   )
 

 
   void PEXSetReflectionAttributes(
        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 surface reflection attributes.

Returns

None.

Description

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

By setting the surface reflection attribute's ASF to PEXIndividual (see PEXOCCSetIndividualASF), you use the pipeline state's surface reflection attributes entry to define the reflection calculation used to light surface primitives. When you set the surface reflection attribute's ASF to PEXBundled, the implementation uses the surface reflection attributes 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 attributes to back-facing as well as front-facing surface interiors. Otherwise the implementation uses the back-facing surface reflection attributes (see PEXOCCSetBFReflectionAttributes).

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 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 reflection attributes, the shinier the surface. If the implementation does not support the specified color type, then the implementation uses a specular color type of PEXColorTypeIndexed with a value of 1. If you specify an indexed color with an index of 65535, then the implementation issues a BadPEXOutputCommand error. If you specify out of range direct color components, then the result is implementation-dependent.

Inquire whether the transmission coefficient is used in the reflection calculation by inquiring the transparency supported via the PEXGetImpDepConstants function. (See also Transparency Method). The transmission coefficient defines the default alpha component of 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.

This function 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.