Skip to main content
GameDev.net gamedev.net
🔒 Locked

Color Key?

Started by barakus Jan 7, 2005 at 6:03 AM 5 replies 1.5k views
Bradsco
Bradsco
Can you be a little more specific? I'm assuming you mean for textures with alpha.
I set the clouds in motion, turn up light and sound...Activate the window, and watch the world go 'round
barakus
barakus
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
python_regious
python_regious
You just generate an alpha channel when you load the texture, based on the specific colour key that you've chosen.
If at first you don't succeed, redefine success.
ghosted
ghosted
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).
kburkhart84
kburkhart84
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.


Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.