Jump to content
  • Advertisement
Sign in to follow this  
species8472

FadeIn / FadeOut

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

Advertisement
If you want to fade in a texture, just do a time based lerp between the texture's color and black. Fade out is the exact opposite.

(Fade-in pseudo code)
Pixel_Color = Lerp(Black, Texture_Color, Time)

If you want to fade in/out a whole scene, you could render it to an off-screen texture and use the same technique as above, while rendering the output to the backbuffer.

Share this post


Link to post
Share on other sites
You could eithe ruse a pixel shader and lerp in there with the time value. Or you can lock teh vertex buffer and modify the alpha part of the vertices (again by using linear interpolation) and then set the texture stage states to modulate between the texture argument and the diffuse argument.

And for fullscreen another option is just drawing a transparent black quad over the screen and slowly lerping the alpha value to 0.

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!