single colour transpancy

Started by
3 comments, last by Harrism 18 years, 2 months ago
Ok it's time for the question. A quick and easy way of single picture transpancy. (Lesson 6 or something uses two images, one as a mask the other as the insert) example, anyshade of a choosen colour (why does everyone seem to use pink?) to be transparent, apparently there is one way without checking every pixel as Gold put it. Thankyou, If there's a tutorial for how to get it done in a quick and dirty way and some documentation I can read to improve the code and learn from that'll be perfect. Sorry for this spoonfeed question but I don't take them lightly and like to learn from them instead. Bunny: This would be a spoonfeed question, but I'm asking for documentation to read up on (read the question).
Advertisement
I'm sorry, but I don't understand what you are asking. Can you try again please?
---When I'm in command, every mission's a suicide mission!
Basicly, single picture where the colour is pink it's transparent. (everyone seems to use pink)

Apparently there is a way of doing it without single pixel drawing / checking, I just don't know how.

I was asking for a quick and dirty tutorial, backed up to a document which I could learn from to improve the code. (best learning stragity)
Pink (magenta I think) is generally used because it stands out, and I think what you are talking about is reading every pixel of an image, checking if it's pink, and if not then copy it over. But you don't want to do that.
I assume that you are using OpenGL as you are in the OpenGL forum so you could check out the blending function glBlendFunc http://msdn.microsoft.com/library/default.asp?url=/library/en-us/opengl/glfunc01_1kz7.asp and go from there. This will also enable you to draw textures in RGBA mode and use an image with an alpha channel, instead of a mask.

As for demos and examples I don't have any handy, but I'm sure one of the NeHe lessons covers transparency.
---When I'm in command, every mission's a suicide mission!
Can a moderate delete this, the question has already been answered.

Thankyou anyway MrZapper

This topic is closed to new replies.

Advertisement