Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: Multiple frames blending

  1. #1
    Newbie Newbie
    Join Date
    Jul 2014
    Posts
    3

    Multiple frames blending

    Hello everyone. I am currently using a shader to render a map on a texture. Since the application has to be real-time and the map accuracy requires multisampling I decided that, instead of doing the sampling in the shader and then outputting the map, I would instead blend the texture over subsequent rendering.
    Ideally I would like to use the 5 previous rendering + the new one and combining them by giving more weight to the latest rendering and least weight to the first. The very first frames are obviously going to be very noisy but after the sixth one I should be able to see a "slightly" flickering version of what I wanted. Is there an efficient way to do this? I am already doing quite some computation so I would prefer a very light solution.

  2. #2
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    3,220
    For legacy implementations/tutorials, websearch "opengl accumulation buffer". You can of course implement this nowadays with off-screen FBOs however you desire.

  3. #3
    Newbie Newbie
    Join Date
    Jul 2014
    Posts
    3
    thanks for the answer, I have seen that accumulation buffer has now deprecated. I was thinking of using FBOs (I already do deferred shading and render to 3 targets) but wouldn't it be too expensive? Also, if this is the best way to go, should I use a gbuffer instead of textures?

  4. #4
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    3,220
    Quote Originally Posted by maik06 View Post
    thanks for the answer, I have seen that accumulation buffer has now deprecated. I was thinking of using FBOs (I already do deferred shading and render to 3 targets) but wouldn't it be too expensive?
    That depends on a lot of things. How you do it. What frame time you've got available for it. What hardware/driver you've got, and its particular performance (cost of rebinding FBOs, etc.)

    Also, if this is the best way to go, should I use a gbuffer instead of textures?
    This didn't make sense to me. It's apples and oranges in a few ways. First, GBuffer would typically be comprised of textures, for the reason that you need to read them back into the shader pipeline in a later pass. Also, the GBuffer contains materials properties, not scene radiances or luminances (e.g. screen colors), but what I assume you want to blend is not the former, but the latter.

  5. #5
    Newbie Newbie
    Join Date
    Jul 2014
    Posts
    3
    I am usign a Geforce gt540m. Right now I do a shadowmap pass (one FBO) then I perform a 3d texture writing using imageStore, then I render 2 textures (one with normals+depth and the other with color in one FBO with 3 targets), then I render this map based on normals+depth and the 3d texture (same FBO, last target) and then I blend everything in a final pass.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •