Jump to content
  • Advertisement
Sign in to follow this  

OpenGL Lighting For 2D OpenGL Game

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

I've been using OpenGL for a while to do 2D graphics. I'm doing a game conversion at the moment. The original version was all software rendering and used some nasty techniques for this effect - copying the frame buffer to a texture. I still don't know a great deal about OpenGL, and I've come across a problem with this conversion. This is how the original software version looks. I'll do my best to explain this. At times the game turns to night with a gradual blue tint over the background and other sprites. There are a number of spot lights around the map. Some of the spot light rectangles overlap. At the centre of the lights, the original background coloring is seen, graduating outwards to the blue tint. I hope that is clear. Now I need to get this working in OpenGL. The light images are circular, graduating from solid white to completely transparent, and there is a semi-transparent (alpha varying over time, as it gets darker) blue rectangle all over the play area. As it is, it doesn't work in OpenGL. I'm thinking I can do this with alpha blending, but I've not managed to get it working. Copying anything back from the frame buffer certainly isn't an option. Any ideas?

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!