PDA

View Full Version : Motion blur using accumulation buffer



des
07-06-2006, 03:24 AM
Hi all! I've got a problem. I'm trying to make motion blur using accumulation buffer. There is no example by this theme in the "Redbook". So, i have the code like this:

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
glAccum(GL_RETURN,1.0); //Drawing last frame, saved in buffer

//Drawing the scene
//...

glAccum(GL_LOAD,1.0); //saving current frame in the buffer
glAccum(GL_MULT, <SomeNumber> ); //make current frame in buffer dim

SwapBuffers(MainDC);
So, as I understand, starting width second frame the motion blur should be rendered. But there is no motion blur. I think when I swap buffers the accumulation buffer is clear, but why? :confused:

zeoverlord
07-06-2006, 05:24 AM
No the accum buffer is not cleared, just overderawn.
so try this instead, though i doupt that you will get a good result.

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );

//Drawing the scene
//...

//make scene a bit dimmer by 1-<SomeNumber>
same <SomeNumber> as below

glAccum(GL_ACCUM,1.0); //adding the current frame to the buffer
glAccum(GL_RETURN,1.0); //Drawing last frame, saved in buffer
glAccum(GL_MULT, <SomeNumber> ); //make current frame in buffer dim

SwapBuffers(MainDC);

I have quick FBO tutorial about this on my site
flashbang.se: FBO feedback tutorial (http://www.flashbang.se/index.php?id=19)

des
07-07-2006, 12:21 AM
Nothing is happening! So 2 questions:
1)Is specified blend function using when accumulating to the buffer, or it's standart function that always the same?
2)Is the depth buffer changing when returning image from accum buffer?

des
07-07-2006, 12:51 AM
Oh! I forgot to include accumulation bits in my PFD - the problem is decided!!!