More alpha blending headaches...

Started by
1 comment, last by MisterHeadache 17 years, 4 months ago
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???
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 );

Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

Got it to to work, just needed to set the SourceBlend and DestinationBlend - didn't need any TextureStates. Thanks.

This topic is closed to new replies.

Advertisement