Fade To/From Black (or other color)

Hi,
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 ?

Thanks

Andrew

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.

Hi

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

Bye
ScottManDeath

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.

Thanks,

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.

Cheers

Andrew

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.

Hi,
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 !

Thanks :slight_smile: