Jump to content
  • Advertisement
Sign in to follow this  
Halsafar

ScreenQuads and rendering to a texture

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

My engines screen fade takes a 'snap shot' of the current rendering routine into a texture. The texture is rendered in screen coords with a black quad fading onto it. Any object which was declared in screen coords, when being rendered to a texture as a render target gets very large... most likely because the textures dimensions are nxn instead of wxh.

Share this post


Link to post
Share on other sites
Advertisement
If you're only fading the whole screen to and from black (or any other solid colour), there is no need to take a snapshot of the current render target or render to a texture.

You can simply draw an *untextured* big black quad after the rest of your scene with Z buffer testing and Z buffer writes disabled (D3DRS_ZENABLE=D3DZB_FALSE or D3DRS_ZWRITEENABLE=FALSE + D3DRS_ZFUNC=D3DCMP_ALWAYS) as well as alpha blending. If you're not using pixel shaders, use the alpha channel of TFACTOR or the vertex colours to control how much to fade out to.

Another (less flexible in some ways) method to fade the whole screen to black is to use IDirect3DDevice9::SetGammaRamp.


BTW: Did you have a specific question? Your post sounds more like a statement than a question!?

Share this post


Link to post
Share on other sites
Heh you know I just redid my entire screen fading routine based on what you just said.
Not only is it simpler without the render to texture I was able to impliment a screen fade in with the same functions... Before all I could was fade out...
Now how I have it set up I could even do screen transitions...almost...

Anyhow, problem solved :)

So very close to releasing a great game for everyone to play.

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!