Jump to content
  • Advertisement
Sign in to follow this  
SiKaNrOnG

Direct X fade-outs and fade-ins.

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

I'm sure that there's an easy way to make DirectX do a fade-out and a fade-in. Unfortunately I don't know what that easy way is. Any help would be welcomed.

Share this post


Link to post
Share on other sites
Advertisement
Draw a solid black quad over the screen and continuously adjust it's alpha color?

Or did you mean a screen transition from one scene to another?

Share this post


Link to post
Share on other sites
As jiia says - adjusting the alpha and/or a combination of render-to-texture calls is a common method.

Alternatives include using the stencil buffer to mask off parts of an image - allowing for some quite complex image transitions.

hth
Jack

Share this post


Link to post
Share on other sites
Quote:
Original post by streamer
Just move up/down the ambiental light color and voala :) you have fade in/out effect.

This won't work, because ambient is added, not multiplied, and you can't have negative ambient color.

Share this post


Link to post
Share on other sites
Quote:
Original post by Coder
Quote:
Original post by streamer
Just move up/down the ambiental light color and voala :) you have fade in/out effect.

This won't work, because ambient is added, not multiplied, and you can't have negative ambient color.


For me it worked :) I decreassed ambiental light and also every other light in scene to 0 :) gradually offcourse.

Share this post


Link to post
Share on other sites
If you use ID3DXSprite, you could just draw any single pixel of a texture, with the modulate color set to black, while changing the alpha part of that color. I don't think it's possible to use ID3DXSprite without a texture, though. If I'm wrong, please let me know. I would love to draw textureless quads with it [smile]

edit:
Quote:
Original post by streamer
For me it worked :) I decreassed ambiental light and also every other light in scene to 0 :) gradually offcourse.

Every other light in the scene could be a problem. Some engines have their lights stored in their map structure, and it seems very strange to change real-world objects to accomplish a fade-out trick.

Share this post


Link to post
Share on other sites
Quote:
Every other light in the scene could be a problem. Some engines have their lights stored in their map structure, and it seems very strange to change real-world objects to accomplish a fade-out trick.


Yeah but the guy want this effect in his own engine (I think so), and this trick is easy to implement.

Share this post


Link to post
Share on other sites
Quote:
Original post by streamer
Yeah but the guy want this effect in his own engine (I think so), and this trick is easy to implement.

My own engine has lights stored in the map structure, hehe.

Share this post


Link to post
Share on other sites
Sign in to follow this  

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