Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Sean Doherty

Fade the Display

This topic is 5370 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 would like to fade my display to black; I really don’t want to use gamma fade. Is there an easy way to dump the back buffer to a vertex buffer and them manipulate the alpha values. I could use addictive blending; but I was thinking that it would be better to capture the current back buffer? Thanks PS: Using DirectX 9. _______________________________________ Understanding is a three edged sword... Independent Games compete Head to Head ... www.FreelanceGames.com

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
What about just drawing a quad right in front of the near clip plane and fading it to black?

Share this post


Link to post
Share on other sites
You''ve already been given the best (I think) general answer. Another easy solution is to fade your lights away, assume you''re rendering normal, lit geometry.

Share this post


Link to post
Share on other sites
I am Alpha Blending a Quad at the front of the scene. However, since the effect of the Alpha Blend is cumulative and I haven''t captured the back buffer the speed of the fade is processor specific? My Quad is not using a texture just a simple diffuse color? How can I get more control over the blending rate?


dwColor = D3DCOLOR_RGBA(0,0,0,9);;
pVertices[0].dwColor = pVertices[1].dwColor = pVertices[2].dwColor = pVertices[3].dwColor = dwColor;

m_pD3DDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
m_pD3DDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);



_______________________________________
Understanding is a three edged sword...

Independent Games compete Head to Head ...
www.FreelanceGames.com

Share this post


Link to post
Share on other sites
Like you should probably be doing with all your game objects, update the alpha of the diffuse black fade polygons with a fixed time scale so that it is as processor independant as possible.

Share this post


Link to post
Share on other sites
Yes, but since the effect is cumulative; I can only call the render 256 times before the screen has been completely faded to black. I could write the code to adjust when I call render but that seems like a hack. Isn''t there a way I can apply the fade effect with more precision? Ideally, I would like to be able to pass the elapsed time and use it as a multiplier for the alpha channel. However, since the effect is cumulative I cannot?

Share this post


Link to post
Share on other sites
Your effect should NOT be cumulative. Each frame, render a black quad in front of the WHOLE SCENE with the alpha of the vertices increasing at some non-CPU dependant rate. That is, always render the scene at full brightness, and then each frame your black quad becomes stronger and stronger based on TIME not FRAME.

Share this post


Link to post
Share on other sites
Keep in mind that I am not clearing the screen, rendering the scene, and then rendering the Quad. I am only rendering the Quad over the existing scene. Maybe, I have my alpha blending settings wrong; but I am seeing a cumulative effect?

Should this be the case?

Share this post


Link to post
Share on other sites
I keep rendering the scene while I fade, I see what you mean now if you don''t. Sounds like you are back to locking the back buffer and changing the pixel values if you can''t continue to render the scene.

Share this post


Link to post
Share on other sites

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