Jump to content
  • Advertisement

Archived

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

invictus

fade image from & to black

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

Is there any built-in way to fade a image from black, wait a couple of seconds and fade to black again using directdraw?

Share this post


Link to post
Share on other sites
Advertisement
No.



In fact, there are two ways of doing it, that I know of firsthandedly...

1. Use the Gamma Ramp controls, which I''ve seen somewhere in the tutorials here, if I remember correctly, or somewhere around the net...

Or

2. Code a custom function which locks input and destination surfaces and read every pixel and applies a percentage to each of its color components, then writes it back to the destination surface.

Correct me if I''m wrong anyone.

Share this post


Link to post
Share on other sites
You could just render a black, alpha-blended rectangle on top of everything. Just increase or decrease the alpha component of the color of the rect to make the final output more black or less black.

DevLiquidKnight: how can you use the view matrix in d3d?

[edited by - circlesoft on March 20, 2004 9:48:45 PM]

Share this post


Link to post
Share on other sites
Generally it''s done with a single alpha blended quad stretched over the screen. This also has the advantage of easily extending to screen flashes, screen blood flashes (a la Doom), blood pouring over your vision (again Doom), underwater, etc.

Share this post


Link to post
Share on other sites
quote:
Original post by circlesoft
You could just render a black, alpha-blended rectangle on top of everything. Just increase or decrease the alpha component of the color of the rect to make the final output more black or less black.

DevLiquidKnight: how can you use the view matrix in d3d?

[edited by - circlesoft on March 20, 2004 9:48:45 PM]


Is this a good way of doing it? is it difficult? and how is the performance?

Share this post


Link to post
Share on other sites
quote:
Original post by Promit
Generally it''s done with a single alpha blended quad stretched over the screen. This also has the advantage of easily extending to screen flashes, screen blood flashes (a la Doom), blood pouring over your vision (again Doom), underwater, etc.


He is using DirectDraw, therefore this is not possible. The only way you are going to get acceptable performance in DirectDraw is to use the Gamma controls, or to ''dissolve'' the screen by adding a few new black pixels to the backbuffer each frame.

Share this post


Link to post
Share on other sites
If anyone has the book Windows Game Programming for dummies I remember there was a fade to black function in there. If I find my copy I''ll be sure to paste the code.

~Wave

Share this post


Link to post
Share on other sites
well if u use direct3d u just change the alpha value of the texture that is drawn to the view matrix but sense your not using direct3d u cant so yea... if you want to do 2d with direct3d look into direct3d sprites.

[edited by - DevLiquidKnight on March 21, 2004 11:41:19 PM]

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!