Anyone here know how to fade the screen in OpenGL? I''m trying to program a very simple intro screen in which I load a bitmap and display it on screen.Then that bitmap fades away and then I load up another bitmap file and display it.I can do all this but I''m not sure how to do the fading bit? Any ideas? Thanx in advance!
If so, try vertex lighting. You use GL_MODULATE to apply the texture, and then glColor() will act as basic lighting for any polys you draw. Start off at glColor3f(1.0, 1.0, 1.0) and work your way down to glColor3f(0.0, 0.0, 0.0)
If you''re using glDrawPixels, you can try the glTransferi command (I don''t really remember the exact parameters needed for it right now), and specify each color''s scale value (using GL_RED_SCALE, GL_GREEN_SCALE, GL_BLUE_SCALE as one of its parameters).
That will be a multiplier for your bitmap output. So, set it to 1 for normal, 0 for none of that color component.
You could draw a transparent surface on top of the bitmap, and then slowly change it''s alpha value until it''s black. I remember having trouble getting alphas to behave properly in 2d (only half the image received the alpha value, never found out what went wrong), so that might not work.