Search Unity

Bug Blocky artifacts on Quest 2 when using transparent materials

Discussion in 'Universal Render Pipeline' started by StaggartCreations, Nov 4, 2020.

  1. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    When using Multiview rendering on Android (GLES 3.0), there's a glaring issue with transparent materials. With multi-pass rendering this isn't the case. Though Multiview is required for shaders that use the depth texture, otherwise it flickers and lags behind the headset movement.

    In URP 7.4.1 (2019.3.7) this occurs, where artifacts show on pixels that are drawn over the transparent material:


    When looking up, the materials appears to clip from back to front (a line perpendicular to the viewing direction)

    In URP 8.0.1 (2020.1) largely the same occurs, but the material also clips when looking down



    In URP 10 (2020.2) the result is the same...

    Note: No transparent materials are visible unless the Post processing checkbox is enabled!

    Summary:
    - Post processing+Multiview+MSAA = Visible materials with blocky artifacts and clipping
    - Multiview+MSAA=Invisible transparent materials
    - Multiview=Correct rendering

    This is what the scene looks like in the editor. The material uses the URP Lit shader set to Transparent.
    upload_2020-11-4_14-30-24.png

    This is pretty alarming behavior and poses an issues for water shaders. What gives?
     
    Last edited: Nov 4, 2020
  2. ThomasZeng

    ThomasZeng

    Unity Technologies

    Joined:
    Jun 24, 2019
    Posts:
    85
    Hey @StaggartCreations,

    Thanks for reporting the issue.
    About the transparent object not rendering in Multiview+MSAA, you might be running into this issue.
    Have you tried submitting a bug report with a repro case? If so, do you mind to post the case number here?

    Thanks,
    Thomas
     
  3. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    It does seem similar, so I think a bug report would amount to the same thing. Though, glad to see there's an explanation, so I can keep my sanity!

    For anyone interested, I ran a number of test builds and mapped their result. Fortunately it is possible to have transparent materials on Quest, but either post processing or MSAA has to be sacrificed.
    upload_2020-11-4_17-37-4.png
     

    Attached Files:

    DigitalIPete2 and ThomasZeng like this.
  4. DigitalIPete2

    DigitalIPete2

    Joined:
    Aug 28, 2013
    Posts:
    44

    Very useful - Thanks.

    Using Unity 20019.4.19.f1 - URP 7.53

    I bought 3 water packages to work on Quest 2, (including yours) but alas none seem to fully work on the device. River Auto Material sort of works but only in one eye (left) the right eye loses sync with the alpha channel (or something) and the result is a flickery image in the right eye. Very distracting on Quest (VR). The digital glitches mentioned above also don't help. In Multiview the mesh/shaders don't render making it impossible to use.

    I'm going to use your table above and move the project to 2020.2 to see if that helps, fingers crossed.
     
    Last edited: Feb 22, 2021
  5. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    I found Multiview is essentially required when looking to use water shaders, otherwise the depth texture rendered by Unity appears to lag behind the headset movement. Water shaders need the depth texture for depth-based effects such as color absorption and shoreline foam.

    But in any event, MSAA and transparent materials simply won't work together on Quest
     
    DigitalIPete2 likes this.
  6. JeffWTD

    JeffWTD

    Joined:
    Dec 17, 2012
    Posts:
    6
    Sorry to reply to an old thread but thought it might help others.

    Another factor here is having the "Opaque Texture" option enabled or disabled in the URP render asset.

    From my own testing, if Opaque Texture is disabled, MSAA will work as expected with transparent textures even with Post Processing off and without any artifacts.

    Guessing it wouldn't help Staggart since they probably need it for the water effects but a lot of applications probably don't need the Opaque texture. It's pretty resource intensive to have it enabled for things like standalone VR anyway.

    Hope this can help someone in the future!
     
  7. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,266
    Good find! It's very likely I had the Opaque Texture option enabled, since it's being utilized for a refraction effect. So that's a spot of hope :)