Transparency for 2d Sprites with Direct3D?

Started by
0 comments, last by Maje 23 years, 1 month ago
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?
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
Stay Casual,KenDrunken Hyena

This topic is closed to new replies.

Advertisement