Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Allebarde

Fade In effect

This topic is 5855 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! I would like to increase my colors so that the screen becomes all white.. but it seems that for Opengl glColor4f(1,1,1,0.5) = glColor4f(2,2,2,0.5). Is it true? Thanks

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Colors range from 0.0f to 1.0f so anything greaer than 1.0f is rounded down to 1.0f afaik.

Share this post


Link to post
Share on other sites
Of course you can. R, G, B, and A each range from 0.0f to 1.0f, inclusive. So, to do just a burst-fade without blending,

*each frame, increment color
*call glColor4f(color, color, color, 1.0f);

But, if you want to fade into a scene using blending, just do this:

*set up an appropriate blendfunc
*increment opacity each frame
*call glColor4f(1.0f, 1.0f, 1.0f, opacity);

Hope that helps.

Peace,
ZE.

//email me.//zealouselixir software.//msdn.//n00biez.//
miscellaneous links

Share this post


Link to post
Share on other sites

  • 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!