Advertisement

fade in screen

Started by December 16, 2003 02:43 PM
1 comment, last by dennizzz 21 years, 2 months ago
how to fade in/out the screen with a nice white color?
Draw scene. Disable depth testing. Enable alpha blending. Draw a white rectangle over the entire screen, with a steadily decreasing alpha value. Disable blending. Enable depth test. When the alpha value reaches 0, your scene is completely visible; you can then stop drawing the rectangle. If you want to fade out again, do the same with an increasing alpha value.
Advertisement
whoomp - there it is!

The only thing I would add is that it''s easier to draw the big white rectangle in 2D mode (glOrtho).

My city demo has code to combine 2D and 3D mode in the routine DoOrthoModeRendering(), I think there''s even code that draws a polygon commented out. Just wrap this with alpha blending as the other poster suggests and voila.

Hope this helps.

Love means nothing to a tennis player

My nothing-to-write-home-about OpenGL webpage. (please pardon the popups!)

This topic is closed to new replies.

Advertisement