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 4 123 ... LastLast
Results 1 to 10 of 36

Thread: should i turn off AA with fullscreen quads

  1. #1
    Senior Member OpenGL Guru
    Join Date
    Jul 2000
    Location
    S41.16.25 E173.16.21
    Posts
    2,407

    should i turn off AA with fullscreen quads

    the title saiz it all!!

    im assuming theres practically no speed difference between the two, is this correct?

    At the moment, im disabling it during the shadowmap creation stage, which makes a large difference (due to on average im rendering far more geometry in this stage than in the normal stage)

    are there any other times i should disable AA?

  2. #2
    Junior Member Regular Contributor PaladinOfKaos's Avatar
    Join Date
    Aug 2005
    Posts
    185

    Re: should i turn off AA with fullscreen quads

    If all of your rendering is to an offscreen buffer, I'd disable AA on your main window and use the fbo_multisample extension for when you need something to be antialised. The latest nVidia drivers support that extension at least back to the GeForce 6, I'm not sure about AMD drivers, but I suspect they support it as well.
    The unofficial community-lead OpenGL SDK is in development! http://glsdk.sourceforge.net

  3. #3
    Senior Member OpenGL Guru Humus's Avatar
    Join Date
    Mar 2000
    Location
    Stockholm, Sweden
    Posts
    2,345

    Re: should i turn off AA with fullscreen quads

    Yes, call glDisable(GL_MULTISAMPLE) before any form of rendering that does not need its edges smoothed, like for instance fullscreen quads (it's better to do a fullscreen triangle though since that eliminates the diagonal edge) or for things like skyboxes (works even if they are drawn last (which they should be) because the sample will still be tested against all destination depth values, so you'll still get AA against the scene geometry).

  4. #4
    Member Regular Contributor
    Join Date
    Apr 2007
    Location
    Fairfax, VA
    Posts
    252

    Re: should i turn off AA with fullscreen quads

    Skyboxes drawn last? That's not the way I learned it.

    I always figured skyboxes should be drawn first with DEPTH_TEST disabled, so that everything else drew in front of them.

  5. #5
    Senior Member OpenGL Guru Humus's Avatar
    Join Date
    Mar 2000
    Location
    Stockholm, Sweden
    Posts
    2,345

    Re: should i turn off AA with fullscreen quads

    Nope. That was true in the Rage 128 era. But ever since Radeon it's been better to draw the skybox last since you can cull large chunks of it with HyperZ. It's the same front-to-back logic as with everything else, and the skybox is most definitely in the back.

    Somehow this seems very unintuitive to a lot of developers, and seven years later we're still struggling with educating developers to do this right. Loads of games shipping today still draw the skybox first, even though it's slower and it should be a trivial fix in many cases.

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

    Re: should i turn off AA with fullscreen quads

    of course you could benefit from early z if you render front to back, assuming you don't need to blend with the background.

    But then again, skyboxes are a bit of a snooze IMHO...

  7. #7
    Senior Member OpenGL Guru Humus's Avatar
    Join Date
    Mar 2000
    Location
    Stockholm, Sweden
    Posts
    2,345

    Re: should i turn off AA with fullscreen quads

    Originally posted by modus:
    of course you could benefit from early z if you render front to back, assuming you don't need to blend with the background.
    Well, if you need to blend with the background the correct order is like this:
    1) Opaque objects
    2) Skybox
    3) Blended objects

    But the skybox should never be draw first, unless everything needs to be blended with it.

    Originally posted by modus:
    But then again, skyboxes are a bit of a snooze IMHO...
    Well, if you have more advanced representation of the environment then most certainly it should be drawn last. The more advanced the more you can gain from this optimization. A plain cubemap may see a couple of percent speedup of the game with this, whereas an advanced multi-layered sky could see much larger gains from it.

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

    Re: should i turn off AA with fullscreen quads

    Well, it depends on what you mean by advanced.

    If you're actually rendering a nontrivial atmosphere with volumetric clouds and such, then there is no one sort order... it's view dependant.

    And what about light shafts, or other cool volumetric atmospheric effects, not to mention single/multiple scattering, arial perspective, etc.

  9. #9
    Senior Member OpenGL Guru
    Join Date
    Jul 2000
    Location
    S41.16.25 E173.16.21
    Posts
    2,407

    Re: should i turn off AA with fullscreen quads

    Yes, call glDisable(GL_MULTISAMPLE) before any form of rendering that does not need its edges smoothed, like for instance fullscreen quads (it's better to do a fullscreen triangle though since that eliminates the diagonal edge)
    champion humus as usual.

    yes i was leaving it on for the skybox (rushes out the room)

    ill change over to drawing a triangle as well instead of a quad (ive heard this before)
    luckily i have a function that goes draw_fullscreen_quad(W,H) so that'll be quick

    i assume the best method is
    point A = corner0
    point B = width*2
    point C = height*2
    or would i need to add 1 to point B (+ perhaps also C) in case it misses the point in the upperright corner?

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

    Re: should i turn off AA with fullscreen quads

    Erm, may i ask, what is the advantage of rendering a triangle over a quad for fullscreen-effects? I mean, it's only ONE triangle less.

    Jan.
    GLIM - Immediate Mode Emulation for GL3

Posting Permissions

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