Jump to content
  • Advertisement
Sign in to follow this  
space_cadet

Fade to Black in D3D without enabling lighting?

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

Hi, I would like to fade my whole screeen to black at the end of a game level. Is there a way to do color fade-ins/fade-outs in a D3D application without enabling lighting, e.g. by changing the way textures are rendered? Regards, Sebastian

Share this post


Link to post
Share on other sites
Advertisement
You may make the screen-size screen-aligned quad with black color , rendered it in front of camera, change the alpha value every frame (start from 0 until 1).

You may also use render-to-surface if you like to play with more transition-effects.

:D

Share this post


Link to post
Share on other sites
Thanks. I just found a really simple solution though:



m_pdDevice->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_TFACTOR);

// set "light" color
//
m_pdDevice->SetRenderState(D3DRS_TEXTUREFACTOR, nColor);


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!