I'm a beginner on directx 9 programming and I have a problem regarding render targets where I wanted to set the backgound to be transparent (transparent to the backbufffer). I used the Clear method and used D3DCOLOR_ARGB where I set the Alpha value to 0. I also have my render target to have a A8R8G8B8 format but the clear ignores the transparency. And when I take the Clear code away, the background messes up with some lines on it. Here is my code:
3dDevice->Clear( 0, NULL, D3DCLEAR_ZBUFFER | D3DCLEAR_TARGET, D3DCOLOR_ARGB(0,0,0,0), 1.0f, 0 );
Here is how I set up my render target:
pd3dDevice->CreateTexture( 400, 400, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &m_pTextureTarget, 0); m_pTextureTarget->GetSurfaceLevel( 0, &m_pSurfaceTarget ); 3dDevice->SetRenderTarget( 0, m_pSurfaceTarget ); 3dDevice->Clear( 0, NULL, D3DCLEAR_ZBUFFER | D3DCLEAR_TARGET, D3DCOLOR_ARGB(0,0,0,0), 1.0f, 0 );
I'm just not sure if I'm missing something. Hopefully, you guys could help out. If you need more info please just ask.
Edited by Daenyx, 10 July 2013 - 11:05 PM.