• Advertisement


This topic is now archived and is closed to further replies.

Another Alpha Blending problem :-)

This topic is 5474 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

i set up alpha blending, but I cant change the material''s alpha value. It''s not changing at all, and drawing always with the same values.
  m_pd3dDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE ); 
m_pd3dDevice->SetRenderState( D3DRS_SRCBLEND,   D3DBLEND_SRCALPHA ); 
m_pd3dDevice->SetRenderState( D3DRS_DESTBLEND,  D3DBLEND_INVSRCALPHA );
for( DWORD i=0; i<m_dwNumMaterials; i++ )
	float af=1.0f;
	m_pMeshMaterials[i].Diffuse	= D3DXCOLOR(af,af,af,af);
	m_pMeshMaterials[i].Emissive = D3DXCOLOR(1.0,1.0,1.0,0.5);
	m_pMeshMaterials[i].Ambient	= D3DXCOLOR(af,af,af,af);

m_pd3dDevice->SetMaterial( &m_pMeshMaterials[i] );
m_pd3dDevice->SetTexture( 0, m_pMeshTextures[i] );

No matter, what i set to af, nothing is changing. Why?

Share this post

Link to post
Share on other sites
Check your alphaOP
maybe set it to
and make your alphacomponent in diifuse color not emmesive

Share this post

Link to post
Share on other sites

  • Advertisement