PDA

View Full Version : Help making a render target transparent



cronodragon
28-10-2006, 03:25 AM
I'm making this:

http://www.teleportmedia.com/mundano/gui_error.jpg

I want to make the black area transparent, and I need help. What I'm doing is drawing the 3D red cylinder in a texture, using setRenderTarget. The texture is created this way:


D3DXCreateTexture(_scene.device, _width, _height, 1,
D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, _texture);

To draw on it I use:


...
_texture.GetSurfaceLevel(0, surf);
_device.SetRenderTarget(0, surf);
end;

_device.Clear(0, nil, D3DCLEAR_TARGET or D3DCLEAR_ZBUFFER, _backColor,
1.0, 0);
...


The I use a ID3DXSprite instance to draw the texture in the screen, so it is placed in the right level of the graphical interface.

Setting the back color's alpha = 0 doesn't make the background transparent, as I supposed. Is there a way to make the rendering texture's background transparent? I have no clue what to do.

I would really appreciate any help on this.

cronodragon
28-10-2006, 06:39 AM
I found the problem myself, I was using a XRGB color instead of ARGB :lol: