Search Unity

Question AR Camera is all colored with material - AR Camera Problem

Discussion in 'AR' started by brianpkenney10, Feb 8, 2023.

  1. brianpkenney10

    brianpkenney10

    Joined:
    Nov 8, 2016
    Posts:
    27
    Not quite sure how else to title this. I was doing the AR Plane detection tutorial on the Unity Learn. When I build to my device, I don't see any of the camera area. It just picks up the plane material. It also looks likes it detecting the flat surfaces that I want it to detect its just that it takes up the rest of the camera space with all the other junk. what would be causing this.

    Unity Version 2021.3.16 Building to iOS 16.3

    Also tried building with the AR Template and the same junk is coming up in the background. The cube is spinning and I can see it. Weird.

    upload_2023-2-8_11-12-27.png
     
    Last edited: Feb 8, 2023
  2. davidmo_unity

    davidmo_unity

    Unity Technologies

    Joined:
    Jun 18, 2019
    Posts:
    99
    So one fast way to ensure it isn't a faulty device thing is to check and see if https://github.com/Unity-Technologies/arfoundation-samples works on your device. Otherwise it almost looks like the background isn't rendering at all and no clear is occurring between frames but we'd need more information on your unity version, package versions, scene settings, rendering settings, URP usage, etc... to be able to say whether it's a bug or a misconfiguration.
     
  3. brianpkenney10

    brianpkenney10

    Joined:
    Nov 8, 2016
    Posts:
    27
    Hey @davidmo_uniuty, thanks for getting back to me. The demo worked great. Thanks for that. But, it seems to happen when I upgrade the projects to use URP for my materials. The demo project materials I am using import in pink so when I upgrade them to URP, the pink goes away...assuming the materials were made for URP. Then I build to my device and it happens. When I build the "Hello World" project with just a cube using the standard shader, everything works fine. Hope this makes sense. Is URP usable with AR Kit?

    Version: Unity 2021.3.16
    URP: 12.1.10
    AR Foundation: 4.2.7

    Please let me know if you need anything else. Thanks.
     
  4. davidmo_unity

    davidmo_unity

    Unity Technologies

    Joined:
    Jun 18, 2019
    Posts:
    99
    URP is supported with all Unity provided AR Providers (ARCore, ARKit) with AR Foundation. If I could clarify, you mean all the non-background materials show up pink in the AR Foundation Samples when using URP? This is to be expected with our samples. Essentially, we use the endorsed URP upgrade path for materials in our samples which is to leave the Built-In Render Pipeline materials as is and allow the user to upgrade the materials via the URP Pipeline converter. If you don't run the converter then the materials outside of the background materials will be pink.

    The background materials are dynamically generated at runtime and they account for URP vs Built-In Render Pipeline as the shaders generate variants for URP and Built-In.
     
  5. brianpkenney10

    brianpkenney10

    Joined:
    Nov 8, 2016
    Posts:
    27
    Yes...I converted all the materials using the Pipeline converter. Thats when the problems starts. I created another project without URP and converted all the materials to Standard and built to my device. Everything comes out great. With the URP project, the default renderer has been set to one for mobile and all materials converted to URP. When I build, thats when the pic above happens. I can't see any of the room...it just looks like that. I am thinking I am missing a setting?