Archived

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

Xeno

Transparent Colorkey in D3D8

Recommended Posts

hi , im trying to write my own d3d bmp texture loading routine. but i cant see any wy that i can set a colorkey to my D3D Texture. the only way is to use D3DX , buti dont want to use it. then , is there any way to set a transparent coloy key in d3d8 to a texture without using D3DX? Thanks , roy.

Share this post


Link to post
Share on other sites
Use a texture with an alpha channel instead of a colourkey. Colourkeying is a DirectDraw technique - many 3d graphics cards don''t support it directly (they fake it with an alpha channel).

--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
oh , then , u mean that i have to go pixel after pixel and if the color is match for the transparent color key , then to set the alpha channel to 0 ? and then to render the texturee with Alpha Blending flag enabled?

Thanks.

Share this post


Link to post
Share on other sites
quote:

oh , then , u mean that i have to go pixel after pixel and if the color is match for the transparent color key , then to set the alpha channel to 0 ? and then to render the texturee with Alpha Blending flag enabled?



Yep, that is a good way to do it. Another (preferable) method is to use an image file format which already has an alpha channel such as TGA (Truevision Targa) or PNG (Portable Network Graphics).


--
Simon O''''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites