• Advertisement

Archived

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

creating transparency

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

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
Advertisement
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
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

  • Advertisement