I am attempting to create a streaking glow effect using ps1.1 in DirectX 8. I have created a glow effect using a gaussian blur on a second "glow" surface that I blend with my main back surface.
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.1
def c0, 0.4, 0.4, 0.4, 0.4
tex t0
mul 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. Does anyone know what I'm doing wrong?
Thanks
[Edited by - Battagline on May 14, 2005 5:58:21 PM]