Color Key?
Yeah exactly so you dont draw the colour specified by the colour key.
In DirectX you could do this when loading the texture. I needed this because i was having some other alpha problems with directx, namely that i was getting a border around the image with the linear filter unless i specified a colour key, but i got that fixed.
Still it would be nice to know :D
In DirectX you could do this when loading the texture. I needed this because i was having some other alpha problems with directx, namely that i was getting a border around the image with the linear filter unless i specified a colour key, but i got that fixed.
Still it would be nice to know :D
You just generate an alpha channel when you load the texture, based on the specific colour key that you've chosen.
This tutorial from codesampler.com may be of some use. It loads a tga and applies an alpha value of 0 to any pixels that are Green (0, 255, 0).
For this problem, I use the TGA file format with 4 channels. Channel number 4 is for the alpha bit anyway, so you don't have to choose a certain color to be transparent, that way there is no mistake. Photoshop and Paint Shop Pro can save TGA files this way, and NEHE can show you how to load them.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement