Jump to content
  • Advertisement
Sign in to follow this  
Toonkides

OpenGL Fading in/out of a scene within OpenGL

This topic is 4826 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 did a search and glanced at a few threads but had no luck. My basic google search and even my poor attempt at browsing nehe didn't prove fruitful either. I have a title screen and a credits screen to a project that I'm currently working on. I can transition the background images just fine, but it's too fast and pretty unpro. Is there a simple way to fade the backgrounds making it more user friendly? Any help/info would be greatly appreciated!

Share this post


Link to post
Share on other sites
Advertisement
Assuming your background images are displayed using a textured quad, you can modulate (multiply) the texture color with the color of the quad using standard OpenGL commands. Just slowly interpolate the color of the quad from black to white and back. When the quad is white (1,1,1) the image will be shown at full brightness, when the color is black (0,0,0) the image will not be visible at all. The gray levels inbetween will cause in the fading in/out effect.
If the image is generated differently, you could put a black quad in front of it. After enabling the proper blending, a similar effect can be achieved by interpolating the translucency of the quad from opaque to transparent and back.

Tom

EDIT: this assumes that with 'fading' you mean fading to black. If you want to morph the images, it will be trickier of course.

[Edited by - dimebolt on August 29, 2005 7:47:33 AM]

Share this post


Link to post
Share on other sites
Way back in my first gl demo, i didnt know how to do otho mode yet, so i tranistioned between scenes, with black fog. Oddly enough it turned out to be a cool effect.

But yeah, blending quads, or just adjusting the color is a much easier way ;)

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!