Texture blending constants

Top  Previous  Next

Constants used by C3DMesh::SetAlphaOperation and C3DMesh::SetColorOperation

 

Constant

Description

D3DTOP_DISABLE

Disables output from this texture stage and all stages with a higher index. To disable texture mapping, set this as the color operation for the first texture stage (stage 0). Alpha operations cannot be disabled when color operations are enabled. Setting the alpha operation to D3DTOP_DISABLE when color blending is enabled causes undefined behavior.

D3DTOP_SELECTARG1

Use this texture stage's first color or alpha argument, unmodified, as the output.

D3DTOP_SELECTARG2

Use this texture stage's second color or alpha argument, unmodified, as the output.

D3DTOP_MODULATE

Multiply the components of the arguments.

D3DTOP_MODULATE2X

Multiply the components of the arguments, and shift the products to the left 1 bit (effectively multiplying them by 2) for brightening.

D3DTOP_MODULATE4X

Multiply the components of the arguments, and shift the products to the left 2 bits (effectively multiplying them by 4) for brightening.

D3DTOP_ADD

Add the components of the arguments.

D3DTOP_ADDSIGNED

Add the components of the arguments with a –0.5 bias, making the effective range of values from –0.5 through 0.5.

D3DTOP_ADDSIGNED2X

Add the components of the arguments with a –0.5 bias, and shift the products to the left 1 bit.

D3DTOP_SUBTRACT

Subtract the components of the second argument from those of the first argument.

D3DTOP_ADDSMOOTH

Add the first and second arguments; then subtract their product from the sum.

D3DTOP_BLENDDIFFUSEALPHA

Linearly blend this texture stage, using the interpolated alpha from each vertex.

D3DTOP_BLENDTEXTUREALPHA

Linearly blend this texture stage, using the alpha from this stage's texture.

D3DTOP_BLENDFACTORALPH

Linearly blend this texture stage.

D3DTOP_BLENDTEXTUREALPHAPM

Linearly blend a texture stage that uses a premultiplied alpha.

D3DTOP_BLENDCURRENTALPHA

Linearly blend this texture stage, using the alpha taken from the previous texture stage.

D3DTOP_PREMODULATE

D3DTOP_PREMODULATE is set in stage n. The output of stage n is arg1.

D3DTOP_MODULATEALPHA_ADDCOLOR

Modulate the color of the second argument, using the alpha of the first argument; then add the result to argument one. This operation is supported only for color operations

D3DTOP_MODULATECOLOR_ADDALPHA

Modulate the arguments; then add the alpha of the first argument. This operation is supported only for color operations

D3DTOP_MODULATEINVALPHA_ADDCOLOR

Similar to D3DTOP_MODULATEALPHA_ADDCOLOR, but use the inverse of the alpha of the first argument. This operation is supported only for color operations

D3DTOP_MODULATEINVCOLOR_ADDALPHA

Similar to D3DTOP_MODULATECOLOR_ADDALPHA, but use the inverse of the color of the first argument. This operation is supported only for color operations

D3DTOP_BUMPENVMAP

Perform per-pixel bump mapping, using the environment map in the next texture stage, without luminance. This operation is supported only for color operations

D3DTOP_BUMPENVMAPLUMINANCE

Perform per-pixel bump mapping, using the environment map in the next texture stage, with luminance. This operation is supported only for color operations

D3DTOP_DOTPRODUCT3

Modulate the components of each argument as signed components, add their products; then replicate the sum to all color channels, including alpha. This operation is supported for color and alpha operations.

D3DTOP_MULTIPLYADD

Performs a multiply-accumulate operation. It takes the last two arguments, multiplies them together, and adds them to the remaining input/source argument, and places that into the result.

D3DTOP_LERP

Linearly interpolates between the 2nd and 3rd source arguments by a proportion specified in the 1st source argument.