Jump to content
  • Advertisement
Sign in to follow this  
PiNtoS

blending an entire scene

This topic is 3876 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

Let's say I have a function DrawScene(), and I'd like to fade it in smoothly. In otherwords, I'd like to write
glColor4f(1, 1, 1, alpha);
DrawScene();

and gradually increase 'alpha'. However, some of the stuff I'm drawing already uses glColor(), and others use various shaders which may ignore or replace the alpha channel. It would be a real pain to have to dig into DrawScene() and change everything to take a variable alpha value. Is there any GL function that will apply (say, multiply) a color to everything that follows, even if it already has one?

Share this post


Link to post
Share on other sites
Advertisement
You could certainly draw a black rectangle, with some amount of transparency, over the entire screen. Not necessarily the absolute fastest way to do it, but it's simple and you won't be fading for long anyway.

Share this post


Link to post
Share on other sites
Sneftels suggestion is generally slightly faster than the render to texture method, the only drawback i can think of is that it doesn't work well if you want to blend between two scenes (For this to work one of the scenes has to be rendered to a texture and blended over the other like sneftel suggested)

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!