Jump to content
  • Advertisement

Archived

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

Maje

Transparency for 2d Sprites with Direct3D?

This topic is 6426 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
Advertisement
G''day!

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:
AlphaOp:Modulate
AlphaArg1:diffuse
AlphaArg2:texture.

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


Stay Casual,

Ken
Drunken Hyena

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!