The accumulation buffer is a separate buffer that can be used to add together (or subtract) multiple renderings from the normal color buffer.
It combines the finished renderings, and so allows for multipass techniques that would otherwise have problems due to depth-buffering or blending conflicts between the different passes.
Applications of the accumulation buffer include:
The functions for using the accumulation buffer are:
glClear(GL_ACCUM_BUFFER_BIT) glAccum(GL_ACCUM, factor) glAccum(GL_RETURN, factor)
Motion blur is simulated by rendering several frames, with objects moved between each rendering, and adding the results together.
The update function for moving objects may need to be modified, to move them by "sub-frame" amounts.
Example: motionblur.cpp
PC hardware, such as current nVidia graphics cards, does not appear to provide hardware support for the accumulation buffer. Using accumulation slows a program down drastically.
A "fake" accumulation buffer can be created using a texture map and glCopyTexImage2D. The results are not quite as good as a real accumulation buffer, because the color resolution will be less.
Example: motionblur-tex.cpp