motion blur

Hi!
How can I implemet this effect with OpenGL ES on a rotating quad?
I’ve tryed this code:

glClear( GL_DEPTH_BUFFER_BIT );
glEnable(GL_BLEND);
glDisable(GL_DEPTH_TEST);
glBlendFunc( GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA );

but when I active the motion blur the quad stop to rotate!
I’ve also tryed only glClear( GL_DEPTH_BUFFER_BIT );and it runs but it’s not a real motion blur beacuse there’s no blending!

The way most games do this, particularly fighting games e.g. Soul Calibur, is to record the position of the sword - or whatever object you want the ‘motion blur’ on - over the previous fraction of a second, and draw a translucent polygon between the rear edge of the sword and it’s position a little while ago. So when the sword moves quickly, you see a bug ‘blur’ (really it’s just a colourful trail) behind it.

Other options are pixel-shader post-processing (requires pixel/fragment shaders :wink: ), or rendering N intermediate frames, and averaging them for the actual final on-screen render. (So, for example, your app needs to be able to run at 300fps in order to average every 10 and effectively give the user 30fps… less a little for the additional 30 renders which have to average 10 screen-res textures… I wrote an app which does this, it means you can do things like depth of field and anti-aliasing for free, the result is kinda fun.)

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.