Advertisement Jump to content


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


Transparency for 2d Sprites with Direct3D?

This topic is 6518 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 tied Gart Simmons great tutoriual on 2D Alpha Bending with Direct3d and it works fine. But I want to have one color in the texture completly tranparent. Is it Possible to use both Colorkeying and Alphabending with D3DTLVERTEX at the same time?. I have tried but i cant get it to work. Does anyone know?

Share this post

Link to post
Share on other sites

I haven''t read that tutorial, but assuming it does blending with the diffuse component of the vertex and you want to add colour keying, it''s easy.

Use D3DXCreateTextureFromFileEx, it allows you to specify a colour key value which will be completely transparent.

I don''t have documentation with me, so this might be a little off, but you set your texture renderstates to:

And that should do it. If my assumptions are wrong, post more detail and I''ll try again.

Stay Casual,

Drunken Hyena

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!