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: Multiple Render Targets and MSAA framebuffer

  1. #1
    Junior Member Newbie
    Join Date
    Dec 2017
    Posts
    16

    Multiple Render Targets and MSAA framebuffer

    Hi all!

    I have an frameBuffer object that has multiple colorbuffers attached to use Multiple Render Targets in off-screen drawCalls, I'm trying to use this with a MSAA framebuffer.
    My Question is : when I use glBlitFramebuffer() to use with intermediate FBO, how can I make them work with MRT technique ?

  2. #2
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    4,511
    Your question isn't very clear. Let's clarify a few things:

    Quote Originally Posted by martel View Post
    I have an frameBuffer object that has multiple colorbuffers attached to use Multiple Render Targets in off-screen drawCalls, I'm trying to use this with a MSAA framebuffer.
    Ok. So do you mean that your FBO (let's call this FBO #1) is MSAA? Or do you mean that your system framebuffer (e.g. window) is MSAA?

    If the latter, why?

    My Question is : when I use glBlitFramebuffer() to use with intermediate FBO, how can I make them work with MRT technique ?
    It's not clear what you're asking by "make them work with MRT". What problems are you having now?

    Also, is this intermediate FBO different from the FBO in the first part (i.e. this is FBO #2)?

    Are you doing MRT just to FBO #1, or to FBO #2 as well?

    Why can't you make it work with MRT now?

    And what's glBlitFramebuffer() have to do with this?

    In general when dealing with glBlitFramebuffer() and MSAA render targets, assuming you're not resizing the images in the blit (i.e. resolution is the same), then you either need the MSAA configuration to match between the framebuffers or you want one to be MSAA and the other not. If src is MSAA and dest is 1x, then the blit will resolve the framebuffer from MSAA to 1x. If src is 1x and dest is MSAA, then the blit will upsample the 1x to MSAA (IIRC).

    If you're talking about the interaction of glBlitFramebuffers() with MRT FBOs, then just realize that there is only one active read buffer (glReadBuffer) for the read framebuffer. So the blit can only resolve one color layer at a time (at least that's my read):

    Quote Originally Posted by OpenGL 4.6 Spec
    void glBlitFramebuffer(...)
    ...
    The actual region taken from the read framebuffer is limited to the intersection
    of the source buffers being transferred, which may include the color buffer selected
    by the read buffer
    , the depth buffer, and/or the stencil buffer depending on mask.
    The actual region written to the draw framebuffer is limited to the intersection of
    the destination buffers being written, which may include multiple draw buffers,
    the depth buffer, and/or the stencil buffer depending on mask. ...
    Last edited by Dark Photon; 10-02-2018 at 05:24 AM.

  3. #3
    Junior Member Newbie
    Join Date
    Dec 2017
    Posts
    16
    Quote Originally Posted by Dark Photon View Post
    If you're talking about the interaction of glBlitFramebuffers() with MRT FBOs, then just realize that there is only one active read buffer (glReadBuffer) for the read framebuffer. So the blit can only resolve one color layer at a time (at least that's my read):
    THIS!

    What I try to do is to be able to use a colorBuffer MSAA that is in the same bufferObject that all the colorsAttachment layers, so this is not possible since you have to read and write from different sources when you resolve MSAA framebuffer using glBlitFramebuffers()

  4. #4
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    4,511
    Quote Originally Posted by martel View Post
    THIS!

    What I try to do is to be able to use a colorBuffer MSAA that is in the same bufferObject that all the colorsAttachment layers, so this is not possible since you have to read and write from different sources when you resolve MSAA framebuffer using glBlitFramebuffers()
    Right. Just use multiple glBlitFramebuffers() calls, one per color buffer, to do the resolve.

Posting Permissions

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