hello,
I’m trying to do motion blur using the alpha buffer.
In order to make the new frame on top and to make the last frame darker, I’m using :
glBlendFunc(GL_ONE,GL_DST_ALPHA), then I draw using
glColor4f(r,g,b, 0.95); if the obect is blurred
glColor4f(r,g,b, 0); if the obect is not blurred
if ® inicates the result, then
R® = R(source) + R(dest)*ALPHA(dest)
G® = G(source) + G(dest)*ALPHA(dest)
B® = B(source) + B(dest)*ALPHA(dest)
->> wich is good for me
but also:
ALPHA® = ALPHA(source) + ALPHA(dest)*ALPHA(dest)
->> the problem is I want :
Motion blur should NOT be a blending of the last few frames. Motion blur is an integration of all positions between the last frame and this frame, or better stated an integration of the positions over the exposure time of this frame. The LAST thing you’d want to do for motion blur is accumulate old frames that have been shown from previous renderings, (unless you are rendering faster than the vertical refresh of the monitor in which case you get away with it for all the wrong reasons).