• Advertisement
Sign in to follow this  

Fades

This topic is 4605 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
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))

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement