LWJGL Forum

Programming => OpenGL => Topic started by: Rene on January 17, 2010, 14:33:16

Title: Motion blur using the accumulation buffer
Post by: Rene on January 17, 2010, 14:33:16
Hi all,

I've been playing a bit with the accumulation buffer lately, and wanted to make a motion blur effect with it. Now I know there are better ways to do it like render to texture, but I wanted to try it using the accumulation buffer anyway :P

What I have at the moment goes as follows:

- Load the accumulation buffer with the color buffer contents (using some float, say blurAmount as scalar)
- Clear the color and depth buffer
- Render the scene
- Accumulate the color buffer contents using 1-blurAmount as scalar
- Return the accululation buffer to the color buffer

However this gives artifacts in darker areas of the screen, the previous (lighter) frames will stay visible until some lighter geometry is drawn at that location. I expected the scalar to take care of this, fading them slowly away.

Here is a screenshot of the artifact. The scene is a chessboard, the bottom of the board is pretty dark. As you can see an older frame is still visible, and doesn't fade away.
http://www.xyzw.nl/lwjglforum/accumulationError.png

The reason I'm asking is not because I'm going to use this effect (I'd use render to texture instead) but I want to understand what I did wrong.