TransparenteFarbe in Direct3D
-
Sorry... zu Text hab ich was gefunden, hab ich gestern wohl nen blöden Begriff im Index angegeben.
Aber zu Transparenz finde ich nix...
Gruß
-
1. Wahrscheinlch erstellst du doch deine Texturen hiermit
HRESULT D3DXCreateTextureFromFileEx( LPDIRECT3DDEVICE9 pDevice, LPCTSTR pSrcFile, UINT Width, UINT Height, UINT MipLevels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, DWORD Filter, DWORD MipFilter, D3DCOLOR ColorKey, D3DXIMAGE_INFO *pSrcInfo, PALETTEENTRY *pPalette, LPDIRECT3DTEXTURE9 *ppTexture );
zu dem PAramter Colorkey heissts in der Doku:
ColorKey
[in] D3DCOLOR value to replace with transparent black, or 0 to disable the colorkey. This is always a 32-bit ARGB color, independent of the source image format. Alpha is significant and should usually be set to FF for opaque color keys. Thus, for opaque black, the value would be equal to 0xFF000000.
pSrcInfoDann brauchst du noch das hier vorm rendern:
d3ddevice->SetRenderState(D3DRS_ALPHABLENENABLE, 1);
Für Text gibt es viele Möglichkeiten. Es gibt im SDK ein Sample, welches eigentlich fast alle aufzeigt.
-
Dann noch:
pD3DDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE); pD3DDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE); pD3DDevice->SetTextureStageState(0, D3DTSS_ALPHAARG2, D3DTA_TEXTURE);
Damit der Alphakanal der Textur auch genutzt wird.
Und natürlich, wie schon gesagt wurde, Alpha-Blending einschalten!
-
Tomas hatte ja eine noch längere Abstinenz als TGGC...
:xmas1: :xmas2:
-
Bw-Grundausbildung...
-
%&%§&$
%&"")))%)§@§$§"€
$$%/&/"€fR%
%%$&/
Alles klar...
-
Bullshit, ich kann sie nicht _hören_.
Bye, TGGC (Denken, und gut ist.)
-
ColorKey
[in] D3DCOLOR value to replace with transparent black, or 0 to disable the colorkey. This is always a 32-bit ARGB color, independent of the source image format. Alpha is significant and should usually be set to FF for opaque color keys. Thus, for opaque black, the value would be equal to 0xFF000000.Der ersetzt die Farbe jetzt, aber die is danach nicht Transparent sondern schwarz. Was mach ich falsch?
Gruß
-
s.o.
Bye, TGGC (Denken, und gut ist.)
-
Achte drauf, dass Dein Texturformat auch einen Alphakanal hat.
Also z.B. D3DFMT_A8R8G8B8, und nicht D3DFMT_X8R8G8B8.
-
Habs nun endlich hin bekommen...
musste zusätzlich noch DestinationBlend auf InvSourceAlpha setzen.
Gruß und Dank
-
TGGC schrieb:
Bullshit, ich kann sie nicht _hören_.
Ihr Maden!!
-
Sgt. Nukem schrieb:
TGGC schrieb:
Bullshit, ich kann sie nicht _hören_.
Ihr Maden!!
private paula;
*SCNR