Motion blur with accumulation buffer
by Luis Anton · in Torque Game Engine · 08/25/2005 (4:48 am) · 2 replies
Hi!
I've been trying to get some simple motion blur effect using the accumulation buffer. I know there's a resource for this, but it doesn't use this buffer, but draws the scene on a texture an all that.
I thought it was easy, at least getting the effect, but it does not work. I'm trying to do it in game.cc, GameRenderWorld.
Basically, the idea is to write and read from the back buffer, then accumulate images and finally swap buffers, isn't it? Something like this:
I get flickering on canvas objects, so something is being done. However, there is no blur effect, and I guess it's because things are being rendered somehow directly on screen, not using the accumulation buffer.
I'm pretty green on openGL, so I may be forgetting a few things (like setting up the accumulation buffer somewhere and somehow). I would like to see it working, just for curiosity, but I can't find why it doesn't. Could someone please help me?
I've been trying to get some simple motion blur effect using the accumulation buffer. I know there's a resource for this, but it doesn't use this buffer, but draws the scene on a texture an all that.
I thought it was easy, at least getting the effect, but it does not work. I'm trying to do it in game.cc, GameRenderWorld.
Basically, the idea is to write and read from the back buffer, then accumulate images and finally swap buffers, isn't it? Something like this:
gldrawbuffer(GL_BACK); glreadbuffer(GL_BACK); ..everything in gamerenderworld... glFlush(); glAccum(GL_ACCUM, 0.8); glAccum(GL_RETURN, 1.0); Video::swapBuffers();
I get flickering on canvas objects, so something is being done. However, there is no blur effect, and I guess it's because things are being rendered somehow directly on screen, not using the accumulation buffer.
I'm pretty green on openGL, so I may be forgetting a few things (like setting up the accumulation buffer somewhere and somehow). I would like to see it working, just for curiosity, but I can't find why it doesn't. Could someone please help me?
#2
glDrawBuffer(GL_BACK);
glReadBuffer(GL_BACK);
glAccum(GL_ACCUM, 1-0.9);
glAccum(GL_RETURN, 1.0);
glAccum(GL_MULT, 0.9);
glFlush();
06/07/2007 (10:36 am)
Just use this.glDrawBuffer(GL_BACK);
glReadBuffer(GL_BACK);
glAccum(GL_ACCUM, 1-0.9);
glAccum(GL_RETURN, 1.0);
glAccum(GL_MULT, 0.9);
glFlush();
Torque Owner Luis Anton
The 'theory' seems to be ok, I've looked in different books, web pages and so on, and the all coincide...