Transparency with Billboards

866cb393e25d89f9b17096b7849c00ba
0
aryasir 101 Feb 11, 2003 at 02:09

Hi there,

I want to Billboard some trees, and obviously trees arnt rectangle, so how do I make the other ares of the trees transparent? Do I have to use alpha blending and the alpha channel, if so, where can i d/l some free software to edit alpha channels (windows 98)? With D3DXCreateTextureFromFileExA is it possible to use the color key specified in that function?
Any ideas? the billboarding tutorial for DX8 is really bad and relies on loads of alpha blending and testing + tga files.

thanks

3 Replies

Please log in or register to post a reply.

Fdbdc4176840d77fe6a8deca457595ab
0
dk 158 Feb 11, 2003 at 02:10

Have you tried the D3DXCreateTextureFromFileEx function with the color key?

07231b4eaab3972437f6c6bd8e99bb64
0
Prock 101 Feb 11, 2003 at 14:14

You could use an alpha mask

Aebe30cac3048af2b72eaf832b698755
0
Amithran 101 Feb 11, 2003 at 17:01

@apex

Have you tried the D3DXCreateTextureFromFileEx function with the color key?

Unfortunatly that damn call takes like 14 parameters. The quick and easy way to do it, is to use D3DXCreateTextureFromFile(). What you need to do though, is open your image editor and MASK the areas you want transparent, then invert the selection (effectivly MASK’ing what you want visible) go to the chanels panel (or how ever your editor manages channels) and make sure that masked is saved as Alpha mask. Save the file as something.tga . Targa files save the mask..

The sprite should now be transparent except for what is masked.