Sign in to follow this  

blending an entire scene

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

This topic is 3600 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this