Archived

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

guyaton

creating transparency

Recommended Posts

guyaton    130
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
tj963    234
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
Christoph    122
if you use the material only for the alpha value, I admit you to leave out materials and create dynamic transparency with the blending factor...

Share this post


Link to post
Share on other sites