The D3DTEXTUREBLEND enumerated type defines the supported texture-blending modes. This enumerated type is used by the D3DRENDERSTATE_TEXTUREMAPBLEND render state in the D3DRENDERSTATETYPE enumerated type.
typedef enum _D3DTEXTUREBLEND {
D3DTBLEND_DECAL = 1,
D3DTBLEND_MODULATE = 2,
D3DTBLEND_DECALALPHA = 3,
D3DTBLEND_MODULATEALPHA = 4,
D3DTBLEND_DECALMASK = 5,
D3DTBLEND_MODULATEMASK = 6,
D3DTBLEND_COPY = 7,
D3DTBLEND_ADD = 8,
D3DTBLEND_FORCE_DWORD = 0x7fffffff,
} D3DTEXTUREBLEND;
cPix = cTex
aPix = aTex
cPix = cSrc * cTex
if( the texture has an alpha channel)
aPix = aTex
else
aPix = aSrc
cPix = (cSrc * (1.0 - aTex)) + (aTex * cTex)
aPix = aSrc
cPix = cSrc * cTex
aPix = aSrc * aTex
cPix = lsb(aTex) ? cTex : cSrc
aPix = aSrc
When the least-significant bit of the texture's alpha component is zero, the effect is as if texturing were disabled.
cPix = lsb(aTex) ? cTex * cSrc : cSrc
aPix = aSrc
When the least-significant bit of the texture's alpha component is zero, the effect is as if texturing were disabled.
cPix = cTex + cSrc
aPix = aSrc
In the formulas given for the members of this enumerated type, the placeholders have the following meanings:
Modulation combines the effects of lighting and texturing. Because colors are specified as values between and including 0 and 1, modulating (multiplying) the texture and preexisting colors together typically produces colors that are less bright than either source. The brightness of a color component is undiminished when one of the sources for that component is white (1). The simplest way to ensure that the colors of a texture do not change when the texture is applied to an object is to ensure that the object is white (1,1,1).
Windows NT/2000: Requires Windows NT 4.0 SP3 or later.
Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
Header: Declared in d3dtypes.h.