fade in/out

Started by
19 comments, last by djsteffey 23 years, 10 months ago
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
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=-..
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

---[home page] [[email=karmalaa@inwind.it]e-mail[/email]]
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 )
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

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
hebertjo
ncsu121978 answered correctly to Anon from me. Good job.


Karmalaa

---[home page] [[email=karmalaa@inwind.it]e-mail[/email]]
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."
-----------------------------A wise man once said "A person with half a clue is more dangerous than a person with or without one."The Micro$haft BSOD T-Shirt
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.
Creativity -- Concept -- CodeYour game is nothing if you don't have all three.http://www.wam.umd.edu/~dlg/terc.htm
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.

This topic is closed to new replies.

Advertisement