Sign in to follow this  
species8472

FadeIn / FadeOut

Recommended Posts

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this