Archived

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

guyaton

creating transparency

Recommended Posts

How do I create an object that I can adjust the Alpha component and increase/decrease its transparency. I tried using the Alpha components in D3DXMaterial9, using the Diffuse/Ambient Colors and g_device3D->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE ); g_device3D->SetRenderState( D3DRS_SRCBLEND, D3DBLEND_DESTALPHA ); g_device3D->SetRenderState( D3DRS_DESTBLEND, D3DBLEND_SRCALPHA ); When I try changing the alpha components, the transparency does not change. What am I doing wrong? ~Guyaton

Share this post


Link to post
Share on other sites
I think you may want something like:

SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);

instead.

tj963

Share this post


Link to post
Share on other sites