Jump to content
  • Advertisement

Archived

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

djsteffey

fade in/out

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

How do you do a fade in and fade out using Direct Draw like most games have with their title screen ? MSVC 6.0 and DirectX 7.0 "Now go away or I shall taunt you a second time" - Monty Python and the Holy Grail themGames Productions

Share this post


Link to post
Share on other sites
Advertisement
In order to fade in/out you have to use 256/8-bit colors which would be using a palette... That''s the easiest/fastest way to get what you want.. you can do a fade in/out wiht 16-bit/24-bit/32-bit colors as well but you would have to use some kind of map... It''s like making a fire demo in 16-bit.. In order to make that I created my own palette colors and used a separate buffer to save the indices of the color form the palette... Anyways... Hope you get the idea.. if not ask some more specific questions and I''ll try to get back to you when possible.. (or maybe someone else would before me

..-=ViKtOr=-..

Share this post


Link to post
Share on other sites
quote:
Original post by Gladiator

you can do a fade in/out wiht 16-bit/24-bit/32-bit colors as well but you would have to use some kind of map...




You can perform fading by simply playing with alpha-channels and do some sort of translucency with a black.

Or you can use gamma values, too.

Search thru'' GameDev''s archive. You should be able to find out some useful references.


Karmalaa

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
You can perform fading by simply playing with alpha-channels and do some sort of translucency with a black.


i tried that a few weeks back - it was damn SLOW
looked cool though.

what do you mean gamma values? i dont see where you''re going with that...(please elaborate, if it helps me get a fast fade going i''ll be one happy camper )

Share this post


Link to post
Share on other sites
Go to the direct draw tutorials on this site......one of the tutorials is doing a fade out with the gamma values......u just do the reverse of the tutorial to fade in


"Now go away or I shall taunt you a second time"
- Monty Python and the Holy Grail
themGames Productions

Share this post


Link to post
Share on other sites
DirectX has a Gamma Interface that will do a great job of fading the screen but it only works in fullscreen mode and not all cards support it. If you want a 16bpp and greater fade in/out function that works on all cards then you can take a look at CDX (www.cdx.sk). It uses a specific case of alpha-blending to perform the fade. It can be found in the CDXScreen class and the function names are FadeToBlack and FadeToSource. It is written in C++ so it should be easy to understand. If you need to speed it up check out my AlphaBlending article here on GameDev.

Goodluck,
hebertjo

Share this post


Link to post
Share on other sites
Im thinking you can draw 3,000 or whatever random pixels to the screen (a.l.a Andre) for a fade in/out. Much simpler, much faster.

-----------------------------

A wise man once said "A person with half a clue is more dangerous than a person with or without one."

Share this post


Link to post
Share on other sites
Cant you just loop through the back buffer and alter the color by some kind of add/subtract to get the desired effect. Doing this in assembly should yeild a decent result. I don''t know enough about the color spaces that you use to provide any code. I have never tried it and it may prove to be too slow.

Share this post


Link to post
Share on other sites
The alpha trianglestrip is the easiest/fastest way of doing it. Trust me, I just did it last night for my contest entry. I also tried it in software mode.

------------------------
Captured Reality.

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!