I am trying to implement an afterglow effect for a radar simulator application using OpenGL. The screen is continuously updated with the contents of new radial scans and "older" scans need to leave a fading trail as time passes and eventually disappear, i.e the
luminocity of the screen contents needs to be continuously reduced by a constant value.
The application needs to run at 16-bit color
depth because of graphics card performance issues.
I've used a texture object to accumulate radial scans so that I only need to render one radial at a time, and then try to "fade" the entire texture to achieve the afterglow effect. My rendering loop involves
the following steps:
1) render texture to screen,
2) render new radial to screen,
3) blend a quad over screen to reduce its brightness,
4) copy contents of screen to texture using glCopyTexImage()
What should the blending function be for this sequence to behave correctly?
I've tried using
glColor3f(reduction, reduction, reduction);
but I don't get the expected results (the blend_subtract extension is present on my system).
What other alternative solutions are there to achieve this effect? Would for instance multitexturing with a separate alpha texture possibly do the trick?