Jump to content
  • Advertisement

Archived

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

flaXen

Alpha test and diffuse alpha blending at the same time?

This topic is 6095 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 use an alpha test to mask a 2D sprite in my game engine. I want to make it so a general alpha transparency can also be used (using the alpha channel in the color attribute of each vertex). How would I go about doing this? Once I enable diffuse alpha blending, it disables alpha testing. Here are my code segments: // To enable diffuse alpha blending g_pd3dDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); g_pd3dDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE); // To enable alpha testing for masking purposes g_pd3dDevice->SetRenderState(D3DRS_ALPHAREF, (DWORD)0x00000001); g_pd3dDevice->SetRenderState(D3DRS_ALPHATESTENABLE, TRUE); g_pd3dDevice->SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_GREATEREQUAL); Any hints would be helpful, Thanks! -- Dan (flaXen)

Share this post


Link to post
Share on other sites
Advertisement
Previous posters wanting to do stuff like this found my answer helpful, you may too:

http://www.gamedev.net/community/forums/topic.asp?topic_id=44040

--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com

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!