Re: Transparency in DX 9.0.
- From: "Jan Bruns" <testzugang_janbruns@xxxxxxxx>
- Date: Sun, 25 Mar 2007 18:45:47 +0200
If you "manually copy" the bitmap, don't you care about 3D
render states, that would even not effect "D3D-copy operations".
D3D9 (in contrast to DD8) isn't focused on surface-handling, but
on GPU rendering 3D. It obviously isn't meant to be used for "playing"
with a collection of surfaces, the few 2D-copy mechanism found in D3D
mainly serve the purpose of getting texture data into the 3D pipeline
(and vice versa).
So you want the image to be copied to a texture (nothing else would
really make sense in D3D)? Then either lock() the surface of the
texture, and really do the manual copy (modified to include the
color-key operation you demand), or, as an alternative, you
could load the bitmap as it is to a texture, and "copy" it to a
final destination RT-texture, by using a screen aligned quad
plus pixel shader.
Gruss
Jan Bruns
<jturner1990@xxxxxxxxxxx> schrieb im Newsbeitrag news:1174839498.444695.307570@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hello,.
I'm manually copying an 8-bit, palettized bitmap onto a small surface
(24x24).
The bitmap is a red ball shape on a black bakground. I do not want
the black background of the image to appear on my white front buffer/
surface.
I have set the following states to signify that black pixels are not
to be rendered:
g_pd3dDevice->SetRenderState(D3DRS_ALPHAREF, (DWORD)0x00000001);
g_pd3dDevice->SetRenderState(D3DRS_ALPHATESTENABLE, TRUE);
g_pd3dDevice->SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_GREATEREQUAL);
** I do not want to use D3DXCreateTextureFromFileInMemoryEx or any of
the other D3DX-based functions.
The black background still appears. Why? How do you get simple
transparency (equivalent to the old-style ColorKey effect) in DX9?
Thanks,
J
- Follow-Ups:
- Re: Transparency in DX 9.0.
- From: Jan Bruns
- Re: Transparency in DX 9.0.
- References:
- Transparency in DX 9.0.
- From: jturner1990
- Transparency in DX 9.0.
- Prev by Date: Transparency in DX 9.0.
- Next by Date: Re: Transparency in DX 9.0.
- Previous by thread: Transparency in DX 9.0.
- Next by thread: Re: Transparency in DX 9.0.
- Index(es):
Relevant Pages
|