View Full Version : Fade To/From Black (or other color)
06-13-2002, 04:37 AM
I've avoided this one until now ... I'm putting an OpenGL splash piece on the front of a project ... Now I'd like to be able to fade into and out of the splash page.
So how do you fade a rendered screen ?
06-13-2002, 07:37 AM
I haven't actually done this, but I'd imagine you could render the full screen to a texture, and then just change the blending over time. If you're just wanting to fade to black, and not a splash-screen image, you could just draw a quad over the full screen and change it's opacity over time.
I imagine someone more experienced here can give more details. http://www.opengl.org/discussion_boards/ubb/smile.gif
06-13-2002, 11:40 AM
perhaps you can use linear glFog to accomplish it. You should render you scene with fog enabled but over time you decreas the start value, so you get the image blend more with the fog
06-13-2002, 11:43 AM
Andrew, you just draw a quad over the whole screen. Start out with a very transparent quad, and gradually change the alpha component until it completely blocks out the image.
06-13-2002, 12:25 PM
I eventually went with the fog method it works well ... GL_LINEAR wasn't quite right as it meant juggling with both start and end but GL_EXP works fine by adjusting GL_FOG_DENSITY.
06-13-2002, 02:26 PM
yuck, I think you should go with ioquan's suggestion. Fog would be non linear in it's occlusion (you might like that), and you still can't fade to a splash screen just to a constant color.
06-14-2002, 01:55 AM
Thanks Dorbie ... yes, although I found that GL_EXP fog setting was fine ... it wasn't so good due to it's non-linearity and it also was fairly obvious that the fade was distant dependent ... so I'm now using a quad ... and it does look much better !
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.