Archived

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

RXB gamer

Alpha blending isn't.....uh....conforming?

Recommended Posts

Ok, so I''ve wanted to get alpha blending to work with my game for awhile now, so I finally decided to do it. But it isn''t working the way I want it to (typical). I''m pretty sure I got the settings right.... { lpDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, TRUE); lpDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND,D3DBLEND_SRCALPHA); lpDevice->SetRenderState (D3DRENDERSTATE_DESTBLEND, D3DBLEND_INVSRCALPHA); } I''ve tried setting the object''s material''s alpha values to 0.0, 0.5, and 1.0 but I get the same result every time: nothing. It doesn''t effect it at all. It''s like the alpha values are always 1. Did you forget a render state or something? When they come for me I''''ll be sittin'''' in my desk with a gun in my hand wearing a bullit-proof vest singing "My, my, my, how the time does fly when you knw your gonna die by the end of the night!"

Share this post


Link to post
Share on other sites
What are your TextureStageStates set to ? - they specify how the alpha value gets from the source data to the polygon blending stage.

For example if you had alpha in your texture you might do:

SetTSS( 0, ALPHAARG1, TEXTURE )
SetTSS( 0, ALPHAOP, SELECTARG1 )
SetTSS( 0, ALPHAARG2, CURRENT )
SetTSS( 1, ALPHAOP, DISABLE )


Also make sure the source data is in a format which contains alpha - for example if it''s your texture, make sure the texture has alpha (e.g. D3DFMT_A8R8G8B8).


Or are you trying to have realtime lighting at the same time as controlled alpha ?

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

Share this post


Link to post
Share on other sites
Have you set the corresponding renderstate D3DRS_DIFFUSEMATERIALSOURCE to D3DMCS_MATERIAL ? Otherwise the default is to take the vertex alpha and not the material one.

Share this post


Link to post
Share on other sites