Microsoft DirectX 8.1 (Visual Basic) |
A blending stage is a set of texture operations and their arguments that define how textures are blended. When making a blending stage, Microsoft® Visual Basic® applications invoke the Direct3DDevice8.SetTextureStageState method. The first call specifies the operation that is performed. Two additional invocations define the arguments to which the operation is applied. The following code example illustrates the creation of a blending stage.
' This example assumes that d3dDevice is a valid reference to a ' Direct3DDevice7 object. ' Set the color operation for the first texture. Call d3dDevice.SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_ADD) ' Set argument 1 to the texture color. Call d3dDevice.SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE) ' Set argument 2 to the iterated diffuse color. Call d3dDevice.SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_DIFFUSE)
Texel data in textures contains color and alpha values. Applications can define separate operations for both color and alpha values in a single blending stage. Each operation, color and alpha, has its own arguments. For details, see CONST_D3DTEXTURESTAGESTATETYPE.