m_pD3DDevice->SetRenderState( D3DRS_COLORVERTEX, TRUE );
m_pD3DDevice->SetRenderState( D3DRS_DIFFUSEMATERIALSOURCE,
D3DMCS_COLOR1 );
m_pD3DDevice->SetRenderState( D3DRS_DIFFUSEMATERIALSOURCE,
D3DMCS_COLOR2 );
m_pD3DDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE);
m_pD3DDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
m_pD3DDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
struct D3DVERTEX
{
D3DXVECTOR3 p;
D3DXVECTOR3 n;
D3DCOLOR diffuse;
D3DCOLOR specular;
float tu, tv;
};
I did lock vertex buffer (DirectX 9) and trying use alpha channel in vertex (set to zero):
((D3DVERTEX*)pSrc)[i].diffuse = D3DCOLOR_ARGB(0, 255, 255, 255);
((D3DVERTEX*)pSrc)[i].specular = D3DCOLOR_ARGB(0, r, g, b);
I set the alpha channel to zero, but it doesn't affect the final image. What is the matter?