Rendering transparent textures in directX

Posted by Vibhore Tanwer on Game Development See other posts from Game Development or by Vibhore Tanwer
Published on 2012-07-06T07:15:56Z Indexed on 2012/07/06 9:24 UTC
Read the original article Hit count: 255

Filed under:

I am working with a directX application with WPF, I am facing a problem with videos and images that contains transparent pixels, I have to draw a color in background an then a video/image over it. What I expect is background color should be visible while playing video only non transparent pixels should be visible but what I get is a black background behind the video. I am using following settings on device to achieve alpha blending :

device.RenderState.SourceBlend = Blend.SourceAlpha; device.RenderState.DestinationBlend = Blend.InvSourceAlpha; device.RenderState.AlphaBlendEnable = true;

What am I missing here? What is the best approach to handle transparent videos? Any help will be of great value to me.

© Game Development or respective owner

Related posts about directx