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

Several transparent sprites over each other?

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

Hi, I have made a pretty nice working sprite-class, that enables me to rotate, scale and translate quad-sprites. When I draw one sprite with a transparent texture, its ok, but when I try to draw several over each other, the transparent bit is drawn black. Is there a flag I have to set to enable multiple levels of transparecy? I set this before I draw each sprite: SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1); and at startup in the engine, I set these: SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); Am I missing something? Btw: The D3DXSprite wrapper I use seems to handle this ok, can''t see a big difference..
Real programmers don''t comment their code, it was hard to write, it should be hard to understand

Share this post

Link to post
Share on other sites