Sign in to follow this  

OpenGL Lighting For 2D OpenGL Game

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

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