D3DTOP_BLENDFACTORALPHA
具体混合方式,查看d3d手册
使用:
D3DTOP_BLENDDIFFUSEALPHA:
g_pd3dDevice->SetTexture(0, g_pTexture);
g_pd3dDevice->SetTexture(1, g_pTexture2);
g_pd3dDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
g_pd3dDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
g_pd3dDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_DISABLE);
g_pd3dDevice->SetTextureStageState(1, D3DTSS_TEXCOORDINDEX, 0);
g_pd3dDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_BLENDDIFFUSEALPHA);
g_pd3dDevice->SetTextureStageState(1, D3DTSS_COLORARG1, D3DTA_TEXTURE);
g_pd3dDevice->SetTextureStageState(1, D3DTSS_COLORARG2, D3DTA_CURRENT);
g_pd3dDevice->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_DISABLE);
D3DTOP_BLENDFACTORALPHA:
g_pd3dDevice->SetTexture(0, g_pTexture);
g_pd3dDevice->SetTexture(1, g_pTexture2);
g_pd3dDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
g_pd3dDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
g_pd3dDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_DISABLE);
g_pd3dDevice->SetRenderState(D3DRS_TEXTUREFACTOR, 0x47ffffff);
g_pd3dDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_BLENDFACTORALPHA);
g_pd3dDevice->SetTextureStageState(1, D3DTSS_TEXCOORDINDEX, 0);
//g_pd3dDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_BLENDDIFFUSEALPHA);
g_pd3dDevice->SetTextureStageState(1, D3DTSS_COLORARG1, D3DTA_TEXTURE);
g_pd3dDevice->SetTextureStageState(1, D3DTSS_COLORARG2, D3DTA_CURRENT);
g_pd3dDevice->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_DISABLE);