• Advertisement
Sign in to follow this  

color masking?

This topic is 4144 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello fellas, Well I tried googling this, but I did not find a solution. Maybe it is right infront of me =\. Anyways to my question, how do I mask(I think this is the right term) a color when loading an image. For instance, when I load "player.tga" the background color is black, how do I replace blacks alpha value to 0 to just show the players image? I hope I worded this so people can understand, Thanks, Tony

Share this post


Link to post
Share on other sites
Advertisement
It might best to generate the alpha where you generate the original graphics and store the alpha in a fileformat that supports this. You can do colorkey->alpha conversion easily in software yourself but the result will be on/off toggle 1-bit alpha, not very good, I'd let the artist control what he wants the graphics to look like.

Share this post


Link to post
Share on other sites
Well it probably would be easy to have the artist just have the images have a transparent background, I would still like to know how to color mask.

-Tony

Share this post


Link to post
Share on other sites
the texture is 3 channels red,G,B
create another texture with 4 channels RGBA +
copy the RGB values over
when u load the texture check each pixel if its black set the alpha to 0 otherwise set it to 1

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement