This topic is now archived and is closed to further replies.


2D lighting and transparency

Recommended Posts

I just read the 'Dynamic 2D Soft Shadows' article by Orangy Tang on GameDev, and found it very interesting for a relative beginner to OpenGL such as myself.t I want to create a circle of light, as shown in the article, that fades away around the edges, but I also want the transparency of the images to be retained. The method of setting all alpha values in the screen buffer to 0, then putting a circle of higher alpha values fading to 0 over the top, then blitting all images using (GL_DST_ALPHA, GL_ONE) as the blending function is beautiful, so long as I don't care about source image transparency. How do I retain the transparency of my images (I use GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA as my blending function for transparency), but also have them fade away, taking into account their source alpha levels.? Do I need to do several rendering passes, and if so, how do I go about it? Thanks guys, Rob [edited by - serenity on January 6, 2004 4:40:59 PM] [edited by - serenity on January 6, 2004 4:42:04 PM] [edited by - serenity on January 6, 2004 4:42:21 PM] [edited by - serenity on January 6, 2004 4:46:26 PM] [edited by - serenity on January 6, 2004 5:18:01 PM]

Share this post

Link to post
Share on other sites