Advertisement

Question about Lesson 9

Started by September 29, 2002 03:05 PM
0 comments, last by snisarenko 22 years, 5 months ago
I have a question about lesson 9. I don''t understand how exactly did the black around the star get removed. What if i wanted to remove another color, say blue or maybe brown. How would i do that ? Please give specific code example (possibly from lesson 9)
You mean how to do transparency?

The secret is the alpha value of the image(or texture). If you set alpha value to 0, and use certain blending mode. The area with alpha value of 0 is going to be transparent.
If you want to set other color to be transparent as well, set the alpha value for that area to be 0. If the picture you use is just RGB(doesn''t supply or contain alpha value). Then loop through all pixels, see if the color is what u need, set the last byte(alpha value) to 0.
I believe this is called color-keying.

This topic is closed to new replies.

Advertisement