Here's my current glow effect:
If I don't clear my glow surface every frame, I get a streaking effect like this:
This creates an interesting streaking effect. The only problem with it, is that eventually the glowing takes up the entire screen and you have a completely white screen. What I would like to do is every frame cut the brightness of each pixel in half. That way, there is a streak effect that doesn't eventually fill the entire screen with white.
I created a pixel shader and rendered the glow texture to itself in an attempt to do this.
Here is the pixel shader code:
ps.1.1def c0, 0.4, 0.4, 0.4, 0.4tex t0mul r0, t0, c0
I then render a screen size quad back to the same glow texture, having set both the render target and the texture to the glow texture.
Here's the code:
g_pDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, FALSE ); g_pDevice->SetRenderTarget( g_pGlowSurface, NULL ); g_pDevice->SetTexture( 0, g_pGlowSurfaceTexture ); g_pDevice->SetPixelShader( g_ResourceManager->m_dwReduceShaderPS ); g_pDevice->DrawPrimitive(D3DPT_TRIANGLEFAN,0,2);
Howevever, I don't get the reduced color that I was looking for.
Here's a few screen shots to show you what happens:
As you can see, the screen still fills with a white color... however, the color is at least somewhat transparent.
I've created threads on GameDev, IGDA, and Indie Gamer in the hopes that someone will be able to help me out on this.