Sign in to follow this  

Fade to Black in D3D without enabling lighting?

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

This topic is 4585 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.

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