Fading in/out of a scene within OpenGL

Started by
2 comments, last by skow 18 years, 7 months ago
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!
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]
Couldn't have been said better or easier.

Thanks much Tom. It's so obvious too >8(
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 ;)

This topic is closed to new replies.

Advertisement