D3DMTEXTUREOP
A version of this page is also available for
4/8/2010
This enumeration provides values that identify the possible operations for the texture stage states D3DMTSS_COLOROP and D3DMTSS_ALPHAOP (see D3DMTEXTURESTAGESTATETYPE).
Syntax
typedef enum _D3DMTEXTUREOP {
D3DMTOP_DISABLE = 1,
D3DMTOP_SELECTARG1 = 2,
D3DMTOP_SELECTARG2 = 3,
D3DMTOP_MODULATE = 4,
D3DMTOP_MODULATE2X = 5,
D3DMTOP_MODULATE4X = 6,
D3DMTOP_ADD = 7,
D3DMTOP_ADDSIGNED = 8,
D3DMTOP_ADDSIGNED2X = 9,
D3DMTOP_SUBTRACT = 10,
D3DMTOP_ADDSMOOTH = 11,
D3DMTOP_BLENDDIFFUSEALPHA = 12,
D3DMTOP_BLENDTEXTUREALPHA = 13,
D3DMTOP_BLENDFACTORALPHA = 14,
D3DMTOP_BLENDTEXTUREALPHAPM = 15,
D3DMTOP_BLENDCURRENTALPHA = 16,
D3DMTOP_PREMODULATE = 17,
D3DMTOP_MODULATEALPHA_ADDCOLOR = 18,
D3DMTOP_MODULATECOLOR_ADDALPHA = 19,
D3DMTOP_MODULATEINVALPHA_ADDCOLOR = 20,
D3DMTOP_MODULATEINVCOLOR_ADDALPHA = 21,
D3DMTOP_DOTPRODUCT3 = 24,
D3DMTOP_MULTIPLYADD = 25,
D3DMTOP_LERP = 26,
D3DMTOP_FORCE_ULONG = 0x7fffffff,
} D3DMTEXTUREOP;
Elements
- D3DMTOP_DISABLE
Identifies that the texture stage is disabled and that the previous stage was the last stage in the texture cascade.
- D3DMTOP_SELECTARG1
Identifies that the output of the stage is equal to ARG1.
- D3DMTOP_SELECTARG2
Identifies that the output of the stage is equal to ARG2.
- D3DMTOP_MODULATE
Identifies that the channels of the ARG1 and ARG2 inputs are multiplied together to form the output value.
- D3DMTOP_MODULATE2X
Identifies that the arguments are multiplied together and the result is shifted left 1 bit, which is equivalent to multiplying by 2.
- D3DMTOP_MODULATE4X
Identifies that the arguments are multiplied together and the result is shifted left 2 bit, which is equivalent to multiplying by 4.
- D3DMTOP_ADD
Identifies that the channels of the ARG1 and ARG2 values are added together.
- D3DMTOP_ADDSIGNED
Identifies that the channels of the ARG1 and ARG2 values are added together with a -0.5 bias.
- D3DMTOP_ADDSIGNED2X
Identifies that the channels of the ARG1 and ARG2 values are added together with a -0.5 bias and that this result is then shifted left 1 bit, which is equivalent to multiplying by 2.
- D3DMTOP_SUBTRACT
Identifies that the channels of ARG2 are subtracted from ARG1 with no saturation.
D3DMTOP_ADDSMOOTH
Identifies that the output will be provided by the following formula.Output = ARG<SUB>1</SUB> + ARG<SUB>2</SUB> - ARG<SUB>1</SUB> * ARG<SUB>2</SUB> = ARG<SUB>1</SUB> + (1 - ARG<SUB>1</SUB>) * ARG<SUB>2</SUB>
D3DMTOP_BLENDDIFFUSEALPHA
Identifies that the output will be a linear alpha blend as defined by the following equation in whichAlpha
is the pixel's diffuse color alpha value.Output = Alpha * ARG<SUB>1</SUB> + (1 - Alpha) * ARG<SUB>2</SUB>
D3DMTOP_BLENDTEXTUREALPHA
Identifies that the output will be a linear alpha blend as defined by the following equation in whichAlpha
is the alpha value of the texture at the current stage.Output = Alpha * ARG<SUB>1</SUB> + (1 - Alpha) * ARG<SUB>2</SUB>
D3DMTOP_BLENDFACTORALPHA
Identifies that the output will be a linear alpha blend as defined by the following equation in whichAlpha
is the alpha channel from the D3DMRS_TEXTUREFACTOR render state (see D3DMRENDERSTATETYPE).Output = Alpha * ARG<SUB>1</SUB> + (1 - Alpha) * ARG<SUB>2</SUB>
D3DMTOP_BLENDTEXTUREALPHAPM
Identifies that the output will be a linear alpha blend with a pre-multiplied ARG1 input as defined by the following formula in whichAlpha
is the alpha value from the texture read at the current stage.Output = ARG<SUB>1</SUB> + (1 - Alpha) * ARG<SUB>2</SUB>
D3DMTOP_BLENDCURRENTALPHA
Identifies that the output will be a linear alpha blend with a pre-multiplied ARG1 input as defined by the following formula in whichAlpha
is the alpha channel of the current color value.Output = ARG<SUB>1</SUB> + (1 - Alpha) * ARG<SUB>2</SUB>
- D3DMTOP_PREMODULATE
Indicates that the current values are multiplied by the texture values from the next stage. This means that if the current stage is n then the output for stage n will be the value in ARG1. The D3DMTA_CURRENT value for stage n+1, however, will be pre-multiplied by the texture value in stage n+1.
D3DMTOP_MODULATEALPHA_ADDCOLOR
Indicates that the output will be an RGB color value provided by the following formula.Output = ARG<SUB>1RGB</SUB> + ARG<SUB>1Alpha</SUB> * ARG<SUB>2RGB</SUB>
This operation is only supported color operations, D3DMTSS_COLOROP.
D3DMTOP_MODULATECOLOR_ADDALPHA
Indicates that the output will be a value provided by the following formula.Output = ARG<SUB>1RGB</SUB> * ARG<SUB>2RGB</SUB> + ARG<SUB>1Alpha</SUB>
This operation is only supported color operations, D3DMTSS_COLOROP.
D3DMTOP_MODULATEINVALPHA_ADDCOLOR
Indicates that the output will be a value provided by the following formula.Output = (1 - ARG<SUB>1Alpha</SUB>) * ARG<SUB>2RGB</SUB> + ARG<SUB>1RGB</SUB>
This operation is only supported color operations, D3DMTSS_COLOROP.
D3DMTOP_MODULATEINVCOLOR_ADDALPHA
Indicates that the output will be a value provided by the following formula.Output = (1 - ARG<SUB>1RGB</SUB>) * ARG<SUB>2RGB</SUB> + ARG<SUB>1Alpha</SUB>
This operation is only supported color operations, D3DMTSS_COLOROP.
D3DMTOP_DOTPRODUCT3
Indicates that the output will be the dot product of the RGB color components for ARG1 and ARG2.Output = ARG<SUB>1R</SUB> * ARG<SUB>2R</SUB> + ARG<SUB>1G</SUB> * ARG<SUB>2G</SUB> + ARG<SUB>1B</SUB> * ARG<SUB>2B</SUB>
The value used for each color component has been scaled and offset to make it signed. The result is then replicated into all three RGB color channels and also the alpha channel.
This operation is only supported color operations, D3DMTSS_COLOROP.
D3DMTOP_MULTIPLYADD
Indicates that the output will use all three possible arguments and be a value provided by the following formula.Output = ARG<SUB>0</SUB> + ARG<SUB>1</SUB> * ARG<SUB>2</SUB>
D3DMTOP_LERP
Indicates that the output will use all three possible arguments and be a value provided by the following formula.Output = ARG<SUB>0</SUB> * ARG<SUB>1</SUB> + (1 - ARG<SUB>0</SUB>) * ARG<SUB>2</SUB>
- D3DMTOP_FORCE_ULONG
Forces the compiler to interpret the enumeration as a ULONG value. This value is not used directly in Direct3D Mobile programming.
Remarks
The members of this type are used when setting color or alpha operations by using the D3DMTSS_COLOROP or D3DMTSS_ALPHAOP values with the IDirect3DMobileDevice::SetTextureStageState method.
Requirements
Header | d3dmtypes.h |
Windows Embedded CE | Windows CE 5.0 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |
See Also
Reference
Direct3D Mobile Enumerations
D3DMTEXTURESTAGESTATETYPE
D3DMRENDERSTATETYPE
IDirect3DMobileDevice::SetTextureStageState