Geometry Buffer Anti-Aliasing demo

Discussion in 'Rendering Technology and APIs' started by Humus, Jul 18, 2011.

  1. Humus

    Humus Crazy coder
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    3,217
    Likes Received:
    77
    Location:
    Stockholm, Sweden
    I have another anti-aliasing technique up on my site. Uses actual geometry like GPAA, but stores info during main scene rendering and resolves with fullscreen pass in the end. Can also anti-alias alpha-tested edges (unlike GPAA). :)

    [​IMG]

    http://www.humus.name/
     
  2. fellix

    Veteran

    Joined:
    Dec 4, 2004
    Messages:
    3,533
    Likes Received:
    492
    Location:
    Varna, Bulgaria
    A denser alpha-texture pattern for the fence openings would be better suited to illustrate the alpha-tested AA.
     
  3. Humus

    Humus Crazy coder
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    3,217
    Likes Received:
    77
    Location:
    Stockholm, Sweden
    Well, you could always throw in this at the top of the pixel shader to try:

    Code:
    #ifdef ALPHA_TEST
        In.TexCoord *= 4.0f;
    #endif
    
    It should be noted though that GBAA is essentially an edge anti-aliasing algorithm, so it will AA the alpha edges, but it's not so much a fix for shader aliasing. So if the alpha-test frequency is too high so that you just get a mess of moire and flickering pixels there is nothing it can do to recover that. However, GBAA makes it a bit softer in this case, so it still looks better, but doesn't really solve it.
     
  4. homerdog

    homerdog donator of the year
    Legend Veteran Subscriber

    Joined:
    Jul 25, 2008
    Messages:
    6,294
    Likes Received:
    1,074
    Location:
    still camping with a mauler
    What would you say is the best way to solve high frequency transparency aliasing?
     
  5. nAo

    nAo Nutella Nutellae
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    4,370
    Likes Received:
    317
    Location:
    San Francisco
    Abandon alpha test, author textures with properly smooth/anti-aliased alpha channels (mip maps included) and embrace order-independent transparency.
     
  6. Humus

    Humus Crazy coder
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    3,217
    Likes Received:
    77
    Location:
    Stockholm, Sweden
    Well, alpha blend tends to sort that out pretty nicely. For MSAA with enough samples something like this works pretty well. For Post-AA some other solution is necessary.
     
  7. homerdog

    homerdog donator of the year
    Legend Veteran Subscriber

    Joined:
    Jul 25, 2008
    Messages:
    6,294
    Likes Received:
    1,074
    Location:
    still camping with a mauler
    Thanks guys :)

    nAo, what do you mean by abandon alpha test? What would you use instead?
     
  8. nAo

    nAo Nutella Nutellae
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    4,370
    Likes Received:
    317
    Location:
    San Francisco
  9. Rodéric

    Rodéric a.k.a. Ingenu
    Moderator Veteran

    Joined:
    Feb 6, 2002
    Messages:
    4,063
    Likes Received:
    960
    Location:
    Planet Earth.
    OMG self promotion !
    ;)
     
  10. MJP

    MJP
    Regular

    Joined:
    Feb 21, 2007
    Messages:
    566
    Likes Received:
    187
    Location:
    Irvine, CA
    If you're using MSAA (and DX10.1 or higher hardware) you can also evaluate the alpha test at subsample frequency.
     
  11. Graham

    Graham Hello :-)
    Moderator Veteran Subscriber

    Joined:
    Sep 10, 2005
    Messages:
    1,480
    Likes Received:
    210
    Location:
    Bend, Oregon
    Humus, nice work :) this is something I've been wanting to try out for ages but could never get it quite right.

    I am curious what a very dense mesh with lots of small / subpixel triangles would look like.
     
  12. Humus

    Humus Crazy coder
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    3,217
    Likes Received:
    77
    Location:
    Stockholm, Sweden
    I have updated the demo with better performance and a fix to rare cases of single pixel errors.
     
  13. Andrew Lauritzen

    Andrew Lauritzen Moderator
    Moderator Veteran

    Joined:
    May 21, 2004
    Messages:
    2,554
    Likes Received:
    640
    Location:
    British Columbia, Canada
    I replied in the SDAA thread since I believe the two are similar (so perhaps we should continue the discussion there), but in my experience it looks noisy. The underlying aliasing of the distance-to-edge buffer shows up as noise in the final image. It's not awful since it's at most 1-pixel away, but it's definitely noticeable and sometimes perceptually worse than the original aliased image.
     
Loading...

Share This Page

  • About Us

    Beyond3D has been around for over a decade and prides itself on being the best place on the web for in-depth, technically-driven discussion and analysis of 3D graphics hardware. If you love pixels and transistors, you've come to the right place!

    Beyond3D is proudly published by GPU Tools Ltd.
Loading...