Jump to content
  • Advertisement

Archived

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

ironhell3

Help on scene fading

This topic is 5958 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 have a game, and i want when changing between levels to fade the scene to black and then from black to next level. I have not idea how to do that.I supposed i could do it with glClearColor but i tried it and i couldn''t.Any help? Oh and i also want to change resolution of the game from inside the game,let''s say have an in-game menu and select on the fly resolutions.Could that be done with nehe''s basecode? Thanks PS You can check my game at http://www.angelfire.com/on3/ironhell3index/HellWorld.html

Share this post


Link to post
Share on other sites
Advertisement
Probably the easiest, and most supported by 3D hardware, is simply rendering a procedurally-translucent quad over the entire screen.

You'd likely want to perform the following:
1) Disable Z-buffer testing
2) Set orthogonal view
3) Enable alpha blending
4) Render the quad from 0,0 to width,height - glColor4f(0, 0, 0, alpha), where alpha is 1.0f for opaque, and 0.0f for transparent
5) Revert to disabled alpha blending, normal view, and enabled Z-buffer testing (in the reverse in which they're changed)

I don't know how fast this would be, but you can certainly test it without too much effort and see if it suits your needs. You can also use it for screen flashes (powerups, damage, nuclear fallout, etc), fades to different colors, etc.

As for the resolution changes/basecode, I don't know because I use different code suited for my own project's purposes. You might try encapsulating everything in Initialize()/Shutdown() functions, and if it's written well enough you should be able to jump in and out of these calls with different values without too much difficulty (this is how I do it).



MatrixCubed
http://MatrixCubed.cjb.net


[edited by - MatrixCubed on June 29, 2002 12:40:45 PM]

Share this post


Link to post
Share on other sites
Using a translucent polygon is probably the fastest, cleanest looking way. Check out some of the demos that NeHe''s hosting on his site, most have source code.

Share this post


Link to post
Share on other sites
quote:
Original post by MatrixCubed
I don''t know how fast this would be, but you can certainly test it without too much effort and see if it suits your needs. You can also use it for screen flashes (powerups, damage, nuclear fallout, etc), fades to different colors, etc.



I find this method works well even on my lower spec machines.

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!