C3DMesh::SetAlphaDest |
Top Previous Next |
Syntax:
SetAlphaDest(UINT dstFactor)
Purpose: Sets the destination alpha blend state..
Parameters: dstFactor - The blending factor.
Returned value(s): None.
Application: pass2.EnableAlpha(TRUE)
Class Hierarchy -------C3DMesh
Additional Info: The default is D3DBLEND_INVSRCALPHA. Source and destination blend states are used in pairs.
Altering the source and destination blend states can give the appearance of emissive objects in a foggy or dusty atmosphere. For instance, if your application models flames, force fields, plasma beams, or similarly radiant objects in a foggy environment, set the source and destination blend states to D3DBLEND_ONE.
Another application of alpha blending is to control the lighting in a 3-D scene, also called light mapping. Setting the source blend state to D3DBLEND_ZERO and the destination blend state to D3DBLEND_SRCALPHA darkens a scene according to the source alpha information. The source primitive is used as a light map that scales the contents of the frame buffer to darken it when appropriate. This produces monochrome light mapping.
You can achieve color light mapping by setting the source alpha blending state to D3DBLEND_ZERO and the destination blend state to D3DBLEND_SRCCOLOR.
See Also:
|