This topic is now archived and is closed to further replies.



Recommended Posts

Harvester    122
Greets. I use the SetColorKey, to access and set to alpha = 0 all the transparent to be pixels. However, when it performs the check, it never seems to succeed it. It never finds any pixel that is supposed to be transparent. Here''s what happens: I use a color key 0x00FF0000 the image does containt this color (exact value). when SetColorKey function scans through it, with A1R5G5B5 format, it sees that all the pixels whose color was supposed to be red, are 0xecc9. I''ve also tried black color, and the results where alike! Any ideas? p.s. After all alpha values are set, what are the states to be set, in order for the alpha effect to take place? I''ve used the following. Let me know if something is wrong, or missing.
	g_pd3dDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, TRUE );
	g_pd3dDevice->SetRenderState( D3DRS_ALPHATESTENABLE,  TRUE );
	g_pd3dDevice->SetRenderState( D3DRS_ALPHAREF,         0x01 );
	g_pd3dDevice->SetRenderState( D3DRS_ALPHAFUNC, D3DCMP_GREATEREQUAL );
... LEMMINGS ... LEMMINGS ... LEMMINGS ... LEM..... SpLaSh!... Is it what we look like on the eyes of destiny or God? Are we LeMmIngS or WhAt!?

Share this post

Link to post
Share on other sites
SikCiv    122
Im not exactly sure what the problem is, though make sure your 3D card can do colorkeying in the first place. If you need something to test the card you can download my small D3D-2D wrapper (includes the source if you need it), follow the link below and click on the ''D3DX Sprite Wrapper'' picture.

  Game Download  ZeroOne Realm

Share this post

Link to post
Share on other sites
KalvinB    102
intialize your 3D offscreen surface like so:

intialize your textures like so:
lpSurface->SetColorKey( DDCKEY_SRCBLT, &key );


Share this post

Link to post
Share on other sites