D3DTEXTUREOP
The D3DTEXTUREOP enumerated type defines per-stage texture blending operations. The members of this type are used when setting color or alpha operations by using the D3DTSS_COLOROP or D3DTSS_ALPHAOP values with the IDirect3DDevice3::SetTextureStageState method.
typedef enum _D3DTEXTUREOP {
D3DTOP_DISABLE = 1,
D3DTOP_SELECTARG1 = 2,
D3DTOP_SELECTARG2 = 3,
D3DTOP_MODULATE = 4,
D3DTOP_MODULATE2X = 5,
D3DTOP_MODULATE4X = 6,
D3DTOP_ADD = 7,
D3DTOP_ADDSIGNED = 8,
D3DTOP_ADDSIGNED2X = 9,
D3DTOP_SUBTRACT = 10,
D3DTOP_ADDSMOOTH = 11,
D3DTOP_BLENDDIFFUSEALPHA = 12,
D3DTOP_BLENDTEXTUREALPHA = 13,
D3DTOP_BLENDFACTORALPHA = 14,
D3DTOP_BLENDTEXTUREALPHAPM = 15,
D3DTOP_BLENDCURRENTALPHA = 16,
D3DTOP_PREMODULATE = 17,
D3DTOP_MODULATEALPHA_ADDCOLOR = 18,
D3DTOP_MODULATECOLOR_ADDALPHA = 19,
D3DTOP_MODULATEINVALPHA_ADDCOLOR = 20,
D3DTOP_MODULATEINVCOLOR_ADDALPHA = 21,
D3DTOP_BUMPENVMAP = 22,
D3DTOP_BUMPENVMAPLUMINANCE = 23,
D3DTOP_DOTPRODUCT3 = 24,
D3DTOP_FORCE_DWORD = 0x7fffffff,
} D3DTEXTUREOP;
Members
- Control members
- D3DTOP_DISABLE
- Disables output from this texture stage and all stages with a higher index. To disable texture mapping, set this operation for the first texture stage (stage 0).
- D3DTOP_SELECTARG1
- Use this texture stage's first color or alpha argument, unmodified, as the output. This operation affects the color argument when used with the D3DTSS_COLOROP texture stage state, and the alpha argument when used with D3DTSS_ALPHAOP.
- D3DTOP_SELECTARG2
- Use this texture stage's second color or alpha argument, unmodified, as the output. This operation affects the color argument when used with the D3DTSS_COLOROP texture stage state, and the alpha argument when used with D3DTSS_ALPHAOP.
- Modulation members
- D3DTOP_MODULATE
- Multiply the components of the arguments together.
- D3DTOP_MODULATE2X
- Multiply the components of the arguments and shift the products to the left one bit (effectively multiplying them by two) for brightening.
- D3DTOP_MODULATE4X
- Multiply the components of the arguments and shift the products to the left two bits (effectively multiplying them by four) for brightening.
- Addition and Subtraction members
- 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 to 0.5.
- D3DTOP_ADDSIGNED2X
- Add the components of the arguments with a -0.5 bias, and shift the products to the left one 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 subract their product from the sum.
- Linear alpha blending members
- D3DTOP_BLENDDIFFUSEALPHA
- D3DTOP_BLENDTEXTUREALPHA
- D3DTOP_BLENDFACTORALPHA
- D3DTOP_BLENDCURRENTALPHA
- Linearly blend this texture stage using the interpolated alpha from each vertex (D3DTOP_BLENDDIFFUSEALPHA), alpha from this stage's texture (D3DTOP_BLENDTEXTUREALPHA), a scalar alpha (D3DTOP_BLENDFACTORALPHA) set with the D3DRENDERSTATE_TEXTUREFACTOR render state, or the alpha taken from the previous texture stage (D3DTOP_BLENDCURRENTALPHA).
- D3DTOP_BLENDTEXTUREALPHAPM
- Linearly blend a texture stage that uses premultiplied alpha.
- Specular mapping members
- D3DTOP_PREMODULATE
- Modulate this texture stage with the next texture stage.
- D3DTOP_MODULATEALPHA_ADDCOLOR
- Modulate the second argument's color using the first argument's alpha, then add the result to argument one. This operation is supported only for color operations (D3DTSS_COLOROP).
- D3DTOP_MODULATECOLOR_ADDALPHA
- Modulate the arguments, then add the first argument's alpha. This operation is supported only for color operations (D3DTSS_COLOROP).
- D3DTOP_MODULATEINVALPHA_ADDCOLOR
- Similar to D3DTOP_MODULATEALPHA_ADDCOLOR, but use the inverse of the first argument's alpha. This operation is supported only for color operations (D3DTSS_COLOROP).
- D3DTOP_MODULATEINVCOLOR_ADDALPHA
- Similar to D3DTOP_MODULATECOLOR_ADDALPHA, but use the inverse of the first argument's color. This operation is supported only for color operations (D3DTSS_COLOROP).
- Bump mapping members
- 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 (D3DTSS_COLOROP).
- 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 (D3DTSS_COLOROP).
- 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.
- Miscellaneous member
- D3DTOP_FORCE_DWORD
- Forces this enumerated type to be compiled to 32 bits in size. This value is not used.
Remarks
In the preceding formulas, SRGBA is the RGBA color produced by a texture operation, and Arg1 and Arg2 represent the complete RGBA color of the texture arguments. Individual components of an argument are shown with subscripts. For example, the alpha component for argument one would be shown as Arg1A.
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
Header: Declared in d3dtypes.h.
See Also
IDirect3DDevice3::GetTextureStageState, IDirect3DDevice3::SetTextureStageState, D3DTEXTURESTAGESTATETYPE