0

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.

tigeradol
  • 259
  • 2
  • 16
  • What makes calculating the average in the shader non-interactive? – Nico Schertler Jul 13 '14 at 16:15
  • if i use the accumulation I can still display the noisy frames whereas, if I do everything in the shader I have to do the equivalent of 5 renderings and then display the frame. – tigeradol Jul 13 '14 at 16:19
  • You can achieve the same result than using the accumulation by some render-to-texture approach. And this is what the driver will likely do anyway when it emulates the existence of an accumulation buffer for you. – derhass Jul 13 '14 at 16:34
  • this is what I though, the problem is that I would have to use imageStore, because the same shader is already writing the frameBuffer – tigeradol Jul 13 '14 at 17:10
  • This is an answer to a somewhat similar question, sketching how to use FBOs in place of old-style accumulation buffers: http://stackoverflow.com/questions/22227871/opengl-supersampling-anti-aliasing/23707991#23707991. – Reto Koradi Jul 13 '14 at 17:24
  • I saw the link. This is applied to the same frame, in case I needed to apply my blending to the previous, let' say, 5 frames, should I store 5 different FBOs? Wouldn't it be too expensive to keep so many and binding to a different one everytime? I already do deferred shading and shadow map so I have 3 FBOs, 1 with 3 targets and the other with only 1 – tigeradol Jul 14 '14 at 14:41

0 Answers0