Advertisement

Fades

Started by July 11, 2005 05:56 AM
3 comments, last by eSCHEn 19 years, 2 months ago
Hi clever people, I am writing a little 2d game which uses a tiles map. The tiles are in one texture which was a 24bit Bitmap. I want to display my map, but make it all black so that nothing can be seen, then slowly fade up so that they can all be seen in thier full colour. Not using a palette in case you thought that. Should I use the colour or should I use lights (which I know nothing about?). Thanks in advance for any advice. Jay
draw a black quad above it and change the alpfa value from 0.0f to 1.0f across several frames. Be sure to enable blending.
Advertisement
They say that the best ideas aer the simplest....thats a fabtastic idea...thanks very much.

As you're using a quad with black colour, don't forget to change the blending function with something like..
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

(I think the default setting is glBlendFunc(GL_SRC_ALPHA, GL_ONE))
Just thought I'd add a wee tip. It is faster to disable blending using glBlendFunc(GL_ONE, GL_ZERO) than with glDisable(GL_BLEND). They amount to much the same thing.
--
Cheers,
Darren Clark

This topic is closed to new replies.

Advertisement