Page 1 of 1

direct3d example texture NOT actually transparent?

Posted: Mon Apr 14, 2008 5:25 pm
by enry2
Hi,

Your Direct3D flash texture example does not seem to produce a texture with alpha. For me, this totally defeats the purpose of using directx.

Please advise if there's anything special that needs to be done to actually make the texture transparent. Obviously the boolean is set to TRUE, thus creating the FPC window with WS_EX_LAYERED.

The D3D texture is A8R8G8B8, so it can carry an alpha.

BITMAP.bmBitsPixel is 32, so there is an alpha channel in the source.

Looking at BITMAP.bmBits, I see that the alpha (fourth byte in each quad, on LSB architecture) is correct, that is to say: I put a square with 50% alpha, and I see 0x7f as expected.

Yes, I am using
d3ddev->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE);
d3ddev->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_SRCALPHA);//alpha
d3ddev->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_INVSRCALPHA);//alpha


So what gives?

TIA.

Posted: Mon Apr 14, 2008 6:26 pm
by Softanics
Thank you for your question.

So, as soon I understand, it gets bitmaps with alpha correctly but directx doesn't seem to render a texture right?

Posted: Mon Apr 14, 2008 7:07 pm
by enry2
DirectX does not seem to render the texture transparency.

The resulting object is completely opaque, even where it should be transparent.