Sign in to follow this  

More alpha blending headaches...

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

This topic is 4020 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this