PDA

View Full Version : Rendering bitmap containing non-rectangular element.



MikeH77
12-10-2002, 02:02 PM
Hello,

I was wondering what is the easiest way to render bitmaps, containing non rectangular elements, through opengl. For example, if I have a bitmap image containing a star, how would I render just the star portion of the image to the screen?

If have done this before in windows using bitblt and having a corresponding mask image. However, I would like to do this in gl now. I image this can be done through blending, but I am not quite sure where to start.

Thanks.
Mike

Old GLman
12-10-2002, 02:22 PM
You'll want to take a look at alpha blending. Read NeHe tutorial #8, its really short and really simple.

Old GLman

nexusone
12-10-2002, 06:07 PM
You can use the alpha channel as a mask for the areas that are to be transparent.

Is my demo call glBall on my website.
http://www.angelfire.com/linux/nexusone/

or on nehe.gamedev.net lesson 33 has an example



Originally posted by MikeH77:
Hello,

I was wondering what is the easiest way to render bitmaps, containing non rectangular elements, through opengl. For example, if I have a bitmap image containing a star, how would I render just the star portion of the image to the screen?

If have done this before in windows using bitblt and having a corresponding mask image. However, I would like to do this in gl now. I image this can be done through blending, but I am not quite sure where to start.

Thanks.
Mike

MikeH77
12-11-2002, 10:32 PM
Thanks everyone!