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: MRT

  1. #1
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,256

    MRT

    Is it possible to render to the backbuffer and a FBO at the same time?
    The GL 2.1 spec doesn't talk about FBOs, so I refered to the GL 3.0 spec.
    p 256 says
    Table 4.5: Arguments to DrawBuffer(s) and ReadBuffer when the
    context is bound to a framebuffer object, and the buffers they indicate.
    i in COLOR ATTACHMENTi may range from zero to the value of
    MAX COLOR ATTACHMENTS - 1.
    ------------------------------
    Sig: http://glhlib.sourceforge.net
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhLoadIdentityf2(matrix);
    glhTranslatef2(matrix, 0.0, 0.0, 5.0);
    glhRotateAboutXf2(matrix, angleInRadians);
    glhScalef2(matrix, 1.0, 1.0, -1.0);
    glhQuickInvertMatrixf2(matrix, inverse_matrix);
    glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
    glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Dec 2000
    Location
    Reutlingen, Germany
    Posts
    2,042

    Re: MRT

    Not as far as i know. The moment you bind an FBO other than 0, you can only render to render-buffers and textures, i do not know of any way to bind the back-buffer as a render-target.

    Jan.
    GLIM - Immediate Mode Emulation for GL3

  3. #3
    Advanced Member Frequent Contributor
    Join Date
    Feb 2006
    Location
    Sweden
    Posts
    744

    Re: MRT

    Nope you can't (i tried).
    you either render to the front and/or back buffers or to FBO buffers.

  4. #4
    Super Moderator Frequent Contributor Groovounet's Avatar
    Join Date
    Jul 2004
    Posts
    937

    Re: MRT

    I really wonder if it is an hardware limitation or just an API limitation. It could be great to be able to the use any framebuffer layer as attachments so that we don't need to reserve extra memory to the depth and stencil buffer for example. Any clue on the possible limitation for that?

  5. #5
    Senior Member OpenGL Pro
    Join Date
    Sep 2004
    Location
    Prombaatu
    Posts
    1,386

    Re: MRT

    It's not a hw limitation but probably a window system interaction difficulty for GL. This is possible in DX, but only because the system framebuffer color target is exposed explicitly as a texture (though in practice I've not had much use for it).

    Of course we can access the framebuffer depth attachment texture via say GL_NV_depth_buffer_float, which is supported even on my HD4650 (though misreported as GL_EXT_depth_buffer_float in the extension string).

Posting Permissions

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