Textures with color-key?

I know in DirectX it is possible to use color-keys to make a color of a texture invisible. In OpenGL I use RGBA-textures to do this but it is very memory expensive.

Is there a way to do color-keying in OpenGL with rgb-textures?

What are color-keys, and how they are used?

You can set a key-color what will be ignored. For example you can say RGB(0,0,0) is your key color, now are all texels with that color invisible (like alpha is 0).

It is usefull for sprites like trees where are holes in the texture. And you don’t need the alpha channel.

OpenGL doesn’t have this feature.

However, the alpha channel only adds an extra 33% more memory. Many video cards store RGB as RGBA anyway, because it is more efficient for them, so it might take up no more extra space.

You might as well use the extra transparency for translucent effects. Or you could have the edges of your sprites at about 50% transparency, which will give an anti-aliased effect.

j

Thanks.