Sign in to follow this  

single colour transpancy

This topic is 4340 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

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).

Share this post


Link to post
Share on other sites
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)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

This topic is 4340 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this