Search Unity

Preventing banding when using AO (even with shadows off)

Discussion in 'General Graphics' started by bphillips09, Jun 22, 2019.

  1. bphillips09

    bphillips09

    Joined:
    Aug 31, 2014
    Posts:
    36
  2. brownboot67

    brownboot67

    Joined:
    Jan 5, 2013
    Posts:
    375
    That's normal bias. Read up on any shadow artifacting sort of thing to get an understanding.
     
  3. bphillips09

    bphillips09

    Joined:
    Aug 31, 2014
    Posts:
    36
    Thanks, although adjusting shadow bias (and even removing all lighting and shadows) has the same effect. I've also tried changing the camera FOV, multiplying/dividing all scales by 10x, and exporting my meshes as watertight. Nothing I have done have made any difference unfortunately.
     
  4. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,343
    What AO are you using?
     
  5. bphillips09

    bphillips09

    Joined:
    Aug 31, 2014
    Posts:
    36
    Unity's PostProcessing V2 AO - Also want to note that it happens with any mesh (even the default primitives)
     
  6. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,343
    I've not seen this specific issue before with Unity's AO, but I have seen it with other engines. It's caused by either not enough precision in the depth buffer, or not enough bias in the AO sampling. To that end @brownboot67 is correct, but Unity doesn't offer any control over the AO sampling bias, and it's usually not needed. If you're using the Multi-Scale AO from V2, you might try playing with the thickness modifier, but I'm not sure if that will have much effect. The other option you could try is pushing the camera's near plane further away. That will significantly increase the depth buffer's accuracy, even increasing it by a small amount.
     
  7. bphillips09

    bphillips09

    Joined:
    Aug 31, 2014
    Posts:
    36
    Thanks for the suggestions! We are using Multi Scale AO, and while the issue doesn't happen when using Scalable, the performance hit is not worth it for us (at least on Mobile). Adjusting the near or far clip planes have only a very small effect, and any value we try just makes the lines close/further apart but they are still there. I guess our only viable option is to bake the AO in Blender or similar.
     
  8. ekakiya

    ekakiya

    Joined:
    Jul 25, 2011
    Posts:
    79
    Yeah, PpsV2's MSVO doesn't work well with the plane almostly facing camera on the narrow angle camera.
    That leads acne, looks like fixed to the distance from camera(not the nonlinear depth value).

    You can scale the value of "tanHalfFovH" in MultiScaleVO.cs to fake the fov for your specific camera.
    It's wrong and changes AO itself, but reduces the acne anyway..