Search Unity

Google ARCore Rendering Issue

Discussion in 'AR' started by TouchPress1234, Jun 22, 2018.

  1. TouchPress1234

    TouchPress1234

    Joined:
    Nov 29, 2017
    Posts:
    2
    I set up the Google ARCore example project the other day and I was able to run the HelloAR scene fine. Yesterday however, I tried to run it again and I'm getting some bizarre rendering problems. It appears to be rendering multiple times in various mirror states, which change depending on orientation. The point cloud dots aren't being cleared every frame, making weird symmetrical lines everywhere. The real world isn't displayed apart from some smudges that might be the camera trying to capture something.

    When I run, logcat come sup with an error saying "Unable to find instant_preview_unity_plugin", which makes me think this might have something to do with the problem. This plugin does not appear to be in the plugins folder. However I don't want to use instant preview, so I've turned it off in ARCore settings, but it still appears.

    I'm running Unity 2018.1.5f1 and I've also tried it in 2017.4.5f1 with the same result. I've run on a Galaxy S9 and a Pixel 2, both with the same result.

    Has anyone come across this before? Thanks.
     
  2. Saicopate

    Saicopate

    Joined:
    Sep 25, 2017
    Posts:
    76
    I get this rendering issue too from time to time. No clue what is the reason, but I am pretty certain it is not the instant preview error. I am using 2018.1 with ARCore package + AR Foundation and I don't get that error (I used to get it previously when using ARInterface).
     
  3. TouchPress1234

    TouchPress1234

    Joined:
    Nov 29, 2017
    Posts:
    2
    Hmm, interesting. Good to know it's probably not instant preview, thanks. I'm not using anything other than ARCore and I'm not trying to debug remotely.

    Do you have any hints at all what might trigger it? it actually worked for me the first few times I ran it and only happened after I came back to it after a few days. Could it really just be something intermittent?
     
  4. Saicopate

    Saicopate

    Joined:
    Sep 25, 2017
    Posts:
    76
    I'm trying to find the cause. What I noticed is that it happens most of the times when rendering one of my 3D objects. On different ones always works ok. I think it has to do with background rendering (camera feed) not updating as you wrote.
    Currently I think disabling shadows completely in Edit -> Project Settings -> Quality works for me but I need to further test it (and this is not optimal solution for me). Try it yourself. Also try different quality settings, e.g. low.
     
  5. kylethekool

    kylethekool

    Joined:
    Jul 23, 2018
    Posts:
    7
    Any progress on this issue? I appear to be having it now as well. I'm using Unity 2018.2.0f2. The problem seems to have appeared after I imported ARKit to the project. The Android portion of the project was working perfectly before, but when I try to run it now, the camera feed background doesn't display and it appears as if new frames are just being overlaid on old ones instead of replacing them.

    Edit: Forgot to add - I also have this problem with the example HelloAR scene. The strange thing is that this problem doesn't happen with Instant Preview.
     

    Attached Files:

    Last edited: Jul 23, 2018
  6. Saicopate

    Saicopate

    Joined:
    Sep 25, 2017
    Posts:
    76
    Today I was fighting with this and found out that the issue was related to one model I was displaying with ARCore which had a negative scale (to have mirror reflection of it).

    When I reverted to positive scale the issue is gone :)
     
  7. kylethekool

    kylethekool

    Joined:
    Jul 23, 2018
    Posts:
    7
    Thanks for the response! That didn't seem to solve my problem though :(. I went through all the GameObjects in my scene (just canvas/ui elements right now) and none of them seem to have negative scales. I also don't touch scale in any scripts. What's really interesting is that everything works perfectly with instant preview, but when building and running on the device I get the strange graphics seen in the screenshot above.
     
  8. kylethekool

    kylethekool

    Joined:
    Jul 23, 2018
    Posts:
    7
    Saicopate likes this.
  9. anuraganandd

    anuraganandd

    Joined:
    Dec 23, 2017
    Posts:
    1
    Found a fix. Just don't keep any scale in negative. It will definitely solve the problem.