Jump to content
  • Advertisement
Sign in to follow this  
MisterHeadache

More alpha blending headaches...

This topic is 4238 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'm hoping this is simple but it's frustrating me. What I have is a texture composed solely of an alpha channel (ie the RGB is white). I want to draw the texture on triangles so that the alpha channel modulates the color value of the vertexes, which are TransformedColoredTextured. Basically this is for displaying bitmap fonts that I can draw in any color. What combos of TextureState's do I need to get this to work? Also, where can one find a detailed user's guide for using alpha & TextureStates???

Share this post


Link to post
Share on other sites
Advertisement
This is for C++ and out of my head but ought to be easy to convert:


SetTextureStageState( 0, D3DTSS_COLORARG1, D3DTA_DIFFUSE );
SetTextureStageState( 0, D3DTSS_COLOROP, D3DTOP_SELECTARG1 );

SetTextureStageState( 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE );
SetTextureStageState( 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1 );

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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!