4

I'm trying to achieve a motion blur effect in my OpenGL application.

I read somewhere this solution, using the accumulation buffer:

 glAccum(GL_MULT, 0.90);
 glAccum(GL_ACCUM, 0.10);
 glAccum(GL_RETURN, 1.0);

 glFlush();

at the end of the rendering loop.

But nothing happens... What am I missing ?

Additions after genpfault answer:

Indeed I did not asked for an accumulation buffer when I initialized my context.

So I tried to pass an array of attributes to the constructor of my wxGLCanvas, as described here: http://docs.wxwidgets.org/2.6/wx_wxglcanvas.html :

int attribList[]={ WX_GL_RGBA , WX_GL_DOUBLEBUFFER , WX_GL_MIN_ACCUM_RED, WX_GL_MIN_ACCUM_GREEN, WX_GL_MIN_ACCUM_BLUE, 0}

But all I get is a friendly Seg fault. Does someone understand how to use this ?

(no problems with int attribList[]={ WX_GL_RGBA , WX_GL_DOUBLEBUFFER , 0})

Klaus
  • 1,241
  • 4
  • 14
  • 31
  • I think you want something like: int attribList[]={ WX_GL_RGBA , WX_GL_DOUBLEBUFFER , WX_GL_MIN_ACCUM_RED, 1, WX_GL_MIN_ACCUM_GREEN, 1, WX_GL_MIN_ACCUM_BLUE, 1, 0} So the minimum bits for red/green/blue accum is 1. – Dr. Snoopy May 30 '10 at 16:28
  • Hmm. I'm still getting a Seg Fault... – Klaus May 30 '10 at 18:48

1 Answers1

2

Make sure to ask for an accumulation buffer when you request an OpenGL context from your windowing system. You probably won't get one by default.

genpfault
  • 51,148
  • 11
  • 85
  • 139