Advertisement

2D lighting and transparency

Started by January 06, 2004 03:40 PM
0 comments, last by serenity 21 years, 2 months ago
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]
*bump*

Anyone have any thoughts, even if they''re "you''re an idiot man, I don''t know what you''re talking about!"?

This topic is closed to new replies.

Advertisement