ScreenQuads and rendering to a texture

Started by
1 comment, last by Halsafar 18 years, 9 months ago
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.
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!?

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

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.

This topic is closed to new replies.

Advertisement