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 4 of 4

Thread: copy color attachment vs mrt

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2009
    Location
    Paderborn, Germany
    Posts
    6

    copy color attachment vs mrt

    Hi,

    i have an FBO with two color attachments in my OpenGL 3 application.
    Both buffers have the same dimensions and precision. I don't use any mipmapping and probably no multisampling.
    The first attachment is filled by a rendering pass.

    Now, i want the contents of the first attachment simply copied into the second one to be used in another render pass.
    This needs to be done each frame.

    What is the fastest way to accomplish this?

    I could use glBlitFramebuffer() or I could use MRT - write the same fragment during the first pass into two color attachments.
    What about glCopyTexSubImage?

    Any suggestions, comments?

    Thanks

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,106
    I would write it in the shader during the first pass - but can I ask if they are identical why you at not just using the first buffer - it can be attached to multiple fbo's.

  3. #3
    Junior Member Newbie
    Join Date
    Sep 2009
    Location
    Paderborn, Germany
    Posts
    6
    I use the GPU for image processing where image files read from disk are converted into an easy-to-process format, then fed into a filtering pipeline and are finally put on the screen.
    If for example one of the filter's settings is changed I have to re-iterate over the whole pipeline including reading from disc, because I need the original image.
    So I'd like to use the first buffer as a read-only backup buffer to avoid per-frame HDD-access.

    Maybe it is better to keep the original image on the CPU-side?
    I just thought if I use the GPU to create the first image format I might as well keep it there, make copy GPU-to-GPU and use the map/umapBuffer method to access the copy.

  4. #4
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,106
    I believe glBlitFramebuffer() is also a gpu-gpu function so it is probably much of a muchness whether you copy this way or write to a second attachment. What ever seems neater in the code.

Tags for this Thread

Posting Permissions

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