Jump to content
  • Advertisement


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


Another Alpha Blending problem :-)

This topic is 5686 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

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!