views:

63

answers:

1

In d3d9types.h in the _D3DRENDERSTATETYPE struct the last 3 types are:

D3DRS_SRCBLENDALPHA             = 207,  /* SRC blend factor for the alpha channel when D3DRS_SEPARATEDESTALPHAENABLE is TRUE */
D3DRS_DESTBLENDALPHA            = 208,  /* DST blend factor for the alpha channel when D3DRS_SEPARATEDESTALPHAENABLE is TRUE */
D3DRS_BLENDOPALPHA              = 209,  /* Blending operation for the alpha channel when D3DRS_SEPARATEDESTALPHAENABLE is TRUE */

Notice it mentions that these will be used if 'D3DRS_SEPARATEDESTALPHAENABLE is TRUE', however there is no D3DRS_SEPARATEDESTALPHAENABLE in the struct whatsoever. The closest thing seems to be: "D3DRS_SEPARATEALPHABLENDENABLE" but I'm not at all sure if this is the same thing.

So i was just wondering what should be set to true for those last three renderstates to actually work (if anything?), I strongly think it's D3DRS_SEPARATEALPHABLENDENABLE but would like someone to please confirm?

+2  A: 

Yep, D3DRS_SEPARATEALPHABLENDENABLE. Looks like a typo in the comments.

From the DXSDK:

D3DRS_SRCBLENDALPHA

One member of the D3DBLEND enumerated type. This value is ignored unless D3DRS_SEPARATEALPHABLENDENABLE is true. The default value is D3DBLEND_ONE.

D3DRS_DESTBLENDALPHA

One member of the D3DBLEND enumerated type. This value is ignored unless D3DRS_SEPARATEALPHABLENDENABLE is true. The default value is D3DBLEND_ZERO.

D3DRS_BLENDOPALPHA

Value used to select the arithmetic operation applied to separate alpha blending when the render state, D3DRS_SEPARATEALPHABLENDENABLE, is set to TRUE.

Valid values are defined by the D3DBLENDOP enumerated type. The default value is D3DBLENDOP_ADD. If the D3DPMISCCAPS_BLENDOP device capability is not supported, then D3DBLENDOP_ADD is performed. See D3DPMISCCAPS.

gatorfax