Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Anti-aliasing comparison

Discussion in 'General Graphics' started by jecky111, Feb 10, 2019.

  1. jecky111

    jecky111

    Joined:
    Jun 11, 2016
    Posts:
    17
    Hi,
    I'm trying to compare different AA solutions in Unity and I got strange values (in attached image).

    MSAA x2 has much better performance over postprocess stack AA effects. Why? Did I measure something terribly wrong or is it supposed to be this way or there's a good reason for this? According to other comparisons I read MSAA is a big performance hit and FXAA should have much lower cost.

    The benchmark scene is from this game: (20 seconds from the menu + the intro + 20 seconds from the gameplay - the benchmark was automated and consistently the same)


    I'm using LWRP (yes I double checked if MSAA is on or off in the pipeline asset and on the camera while doing the different benchmarks).
    While I was testing I used empty postprocessing layer (no pp effect applied other than the AA's) even if I turned on pp layer for a control benchmark.
    Test config: xiaomi redmi note 4, android 7.0, 3 gb ram, full hd resolution.
    Unity alpha v13 with it's latest updated LWRP and PP stack versions.
     

    Attached Files:

  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,329
    Usually when doing performance comparisons between AA techniques you're comparing against MSAA 4x or great, not 2x which barely better than no AA at all.

    FXAA compares well against 4x
    SMAA compares well against 4x or 8x
    TAA compares well against 8x or even 16x (under the hood it's closest to "12x", an option that doesn't even exist on modern GPUs)

    However the common "post AA performs better than MSAA" phrase is usually in the context of desktop or console GPUs where there is a ton of extra shader perf, not mobile GPUs. Most frequently the reverse is true for mobile because the way those GPUs work mean MSAA is sometimes less expensive than desktop GPUs, but the overall shader performance is much lower.
     
    jmcgraw961, NotaNaN, sirleto and 5 others like this.
  3. jecky111

    jecky111

    Joined:
    Jun 11, 2016
    Posts:
    17
    Oh now it makes sense, thank you again. I learn a lot from you!
     
  4. Adam-Bailey

    Adam-Bailey

    Joined:
    Feb 17, 2015
    Posts:
    232
    Yeah, unfortunately a lot of the time you just need to do a ton of testing and reading to figure out what is best for a particular platform.

    I do a fair bit of mobile VR stuff, and with the GearVR/Go the way the system is bottlenecked 2xMSAA and even sometimes 4xMSAA can essentially be turned on for "free".
     
    chrismarch likes this.