Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: GL_ARB_multisample

  1. #1
    Junior Member Newbie
    Join Date
    Apr 2011
    Posts
    13

    GL_ARB_multisample

    So I'm trying to use multisampling to hopefully help some of the jaggedness my application currently has. Unfortunately, glEnable(GL_ARB_multisample) appears to make no difference on my final image. Is this the correct way to use it?

    Using glxinfo it appears my system supports GL_ARB_multisample, so I'm not sure what's wrong here.

  2. #2
    Advanced Member Frequent Contributor Aleksandar's Avatar
    Join Date
    Jul 2009
    Posts
    952

    Re: GL_ARB_multisample

    You need to create a "multisampled" rendering target. Choose pixel format that supports multi-sampling (with appropriate MS factor), or a FBO.

  3. #3
    Senior Member OpenGL Pro Ilian Dinev's Avatar
    Join Date
    Jan 2008
    Location
    Watford, UK
    Posts
    1,262

    Re: GL_ARB_multisample

    Also note that glEnable(GL_MULTISAMPLE) will change nothing, as it's enabled by default.

    glEnable(GL_ARB_multisample); // is something invalid

  4. #4
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    2,891

    Re: GL_ARB_multisample

    Quote Originally Posted by Ilian Dinev
    Also note that glEnable(GL_MULTISAMPLE) will change nothing, as it's enabled by default.
    Right. Just to clarify the above, you need both of the above to do proper multisample rasterization and downsample filtering:

    1. Create a multisampled render target
    2. glEnable( GL_MULTISAMPLE ) (or just leave it enabled)


    And I have no idea what you're talking about with glEnable( GL_ARB_multisample ). GL_ARB_multisample is the name of an OpenGL extension and not a GL state enable. In glext.h, it is a preprocessor symbol used to prevent multiple includes and is defined to 1 like all other similar preprocessor lock symbols. Your glEnable would translate to glEnable(1) which probably isn't even valid. It's not what you want anyway.

  5. #5
    Member Regular Contributor trinitrotoluene's Avatar
    Join Date
    Sep 2008
    Location
    Montérégie,Québec
    Posts
    361

    Re: GL_ARB_multisample

    Quote Originally Posted by Ilian Dinev
    Also note that glEnable(GL_MULTISAMPLE) will change nothing, as it's enabled by default.

    glEnable(GL_ARB_multisample); // is something invalid
    I have an AMD Radeon HD 5870 under Ubuntu and multisampling is not enabled by default with a multisample renderbuffer attached to a FBO. I must call glEnable(GL_MULTISAMPLE) explicitly. On the default framebuffer too I need to explicitly enable multisampling. But unfortunately, since catalyst 11.7 multisampling on the default framebuffer is not working for me.

  6. #6
    Junior Member Newbie
    Join Date
    Apr 2011
    Posts
    13

    Re: GL_ARB_multisample

    I see. I didn't know it was an include safety. Either way, given that I have this opengl extension, shouldn't I be able to enable multisampling?

    After a bit more research, I'm finding SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 2); fails with "Couldn't find matching GLX visual" when SDL_SetVideoMode() is called. Maybe it's in my x settings?

  7. #7
    Member Regular Contributor trinitrotoluene's Avatar
    Join Date
    Sep 2008
    Location
    Montérégie,Québec
    Posts
    361

    Re: GL_ARB_multisample

    Did you set also this:
    Code :
    SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS,1);

    To get the number of samples available call
    glGetIntegerv(GL_SAMPLES,&samples);

    On my old computer with nvidia TNT2 with the mesa OpenGL software driver, the extension GL_ARB_multisample was supported but with only one sample per pixel. So check the visual available with glxinfo.In the last column (ms), there is the (ns = number of samples) and (b=number of multisample buffer) listed.

  8. #8
    Junior Member Newbie
    Join Date
    Apr 2011
    Posts
    13

    Re: GL_ARB_multisample

    As it turns out, both MULTISAMPLEBUFFERS and MULTISAMPLESAMPLES throw that error. GL_SAMPLES appears to be zero. Maybe my system doesn't support it?

    EDIT: It has zero in both ns and b throughout the entire list. I guess I misinterpreted GL_ARB_MULTISAMPLE being listed as an extension under server, client, GLX, and OpenGL, extensions as supporting it. I do have an integrated graphics card, but it was worth trying.

  9. #9
    Senior Member OpenGL Pro Ilian Dinev's Avatar
    Join Date
    Jan 2008
    Location
    Watford, UK
    Posts
    1,262

    Re: GL_ARB_multisample

    Quote Originally Posted by trinitrotoluene
    I have an AMD Radeon HD 5870 under Ubuntu and multisampling is not enabled by default with a multisample renderbuffer attached to a FBO. I must call glEnable(GL_MULTISAMPLE) explicitly. On the default framebuffer too I need to explicitly enable multisampling.
    That's a driver bug then. The spec clearly states that GL_DITHER and GL_MULTISAMPLE are GL_TRUE by default.

  10. #10
    Junior Member Newbie
    Join Date
    Apr 2011
    Posts
    13

    Re: GL_ARB_multisample

    Is GL_ARB_multisample unrelated to number of samples and buffer support then?

Posting Permissions

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