Search Unity

Bug [RESOLVED] Mesh rendering acting in a weird way on Android in Augmented Reality only.

Discussion in 'AR' started by Strateolab_team, May 12, 2023.

  1. Strateolab_team

    Strateolab_team

    Joined:
    Feb 16, 2018
    Posts:
    8
    Hi ! My character seems to have some visual bugs on every polygons of his body (Video down below), more specifically only in Augmented Reality on Android (IOS Not Tested). Our app provide a way to see those character in a 3D scene too without any AR and there is absolutely no visual bugs.

    Knowing that only AR would provide the bug and not the 3D View, I did not try to change Anim. Compression to Off, but I will try it soon.

    The project is on Unity 2020.3.0f1 and the packges ArFoundation, ArcoreXRPlugin and ArKitXRPlugin are on 4.0.12 version.

    I think recalling the problem was not there at some points, but I can't 100% confirm it.

    Some things have been tried:

    • For Every Quality Level.
      • Skin weight to 4 Bones.

      • VSync Count to Don't Sync.
    Additional Infos:

    • The character has Blend Shapes animations.

    • There is no LOD on the character.

    • The FBX Frame Per Second settings was zero (The setting is embbed in the model) and Unity set it automatically to 1, but it's not causing any trouble whatsoever.
    Do someone have a lead what could create this kind of glitches?


    What's happening in AR only (There is mouse cursor since the recording has been made via ScreenCopy)


    Quality settings for the Low and High Settings:
    https://imgur.com/a/IpDIZBN


    Import setting of the model:
    https://imgur.com/a/reFex46
     
    Last edited: May 12, 2023
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,060
    1. Try the latest 2020 lts if possible.
    2. Does this happen in AR only or android only? Did you try on android without AR?
    3. Did you try without keyframe reduction?
    4. Is the scale of the object in the scene 1?
     
  3. Strateolab_team

    Strateolab_team

    Joined:
    Feb 16, 2018
    Posts:
    8
    Hi ! thanks for your response :)
    1. Update to 2020 -> I plan to test it in last resort since the project is due soon, but it's duly noted
    2. This happens only in AR on Android. I must say that IOS version hasn't been tested yet. The app has two modes, AR viewing and 3D viewing. The 3D Viewing has absolutely no problems like this.
    3. Removing Keyframe reduction -> I will comeback with results soon
    4. One parent in the hierarchy was 0.3, 0.3, 0.3. I set it to 1 for each axis but even if the Character was enormous, the Z-Fighting glitch was still present. :(
    I will keep the thread updated as soon as I test the other options!
     
  4. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,060
    Are you sure you are not spawning 2 models on top of each other?
     
  5. Strateolab_team

    Strateolab_team

    Joined:
    Feb 16, 2018
    Posts:
    8
    After the deactivation of some part of the character, I can certify that only one Model is there. I deactivated an eye and could see through it the head (tested being in Android build via Runtime Inspector)
     
  6. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,060
    Why does disabling the eyes prove there's only one?
    Use debug log out something similar.
     
  7. Strateolab_team

    Strateolab_team

    Joined:
    Feb 16, 2018
    Posts:
    8
    As I was saying, I used Runtime Inspector & Hierarchy and have been looking at the actual scene hierarchy to see if a duplicate character was there; There wasn't.

    When I deactivated the eye, it was with this tool. So the theory of two characters superposed exactly at the same spot isn't right since deactivating the eye and the head did make the character disappear. :)

    The tool : https://assetstore.unity.com/packages/tools/gui/runtime-inspector-hierarchy-111349

    Also in combination of https://assetstore.unity.com/packages/tools/integration/log-viewer-12047
    that let me see the debug.log, warnings and errors.
     
  8. Strateolab_team

    Strateolab_team

    Joined:
    Feb 16, 2018
    Posts:
    8
    After trying some things, I found that the object that was parenting ARSession had a position like:
    x : 4000, y : 1024, z : -5 so I set it to 0,0,0.
    In the same attempt, i've also changed the shader of certain the materials to UniversalRenderPipeline/SimpleLit instead of Lit.

    It's very more likely that the position is the culprit.
    Thank you for your support !
     
    andyb-unity and DevDunk like this.