I am rendering a scene using a very simple path tracer using GLSL. I create a map in screen space by using some of the information from the path tracing. In the first frame the map looks very noisy (because has mostly 0s), but in the next frame I change the sample and I would like the new map to be averaged with the previous one.
I know there is accumulation buffer but it has deprecated and I think that it would be a costly solution for such simple feature.
In my shader I currently render the map and a final image and display this second one. In the next frame I want to use compute a new map and accumulate it with the previous one in order to render this new frame. Ideally I would like to accumulate 5 subsequent frames.
I hope I made the question clear enough. I don't want to compute the samples and accumulation in the shader because I want the program to still be interactive, even if noisy.