RenderLook up "rendering to textures" in OpenGL. This will let you render your scenes to alternating render targets backed by textures named, say, A and B. By alternating them, one texture always contains “this frame” and the other the “last frame.”
Then you can bind them both and render a single full screen triangle to composite themSo every frame, averaging the colors as you like.you'd:
- Swap A and B.
- Bind A as a render target; render the game as normal to A.
- Bind A and B as textures to read from.
- Render a single triangle (or quad) that covers the full screen using a fragment shader that samples from both A and B and blends them however you want.