Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug AR Foundation 4 VS 5 & URP 12 VS 14 - Correct VS Black Background

Discussion in 'AR' started by newguy123, Dec 11, 2022.

  1. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Hi Guys

    Have an issue here.

    I simple project with just a spinning cube:

    Unity 2021.3.1f1, URP 12.1.6, AR Foundation 4.2.3
    Build to Android device, everything works fine and great

    However, either UPGRADING that project, or redoing it from scratch with newer Unity and Packages results in Black/Blank Cam feed, with only the spinning cube visible when building
    Unity 2022.2.0f1, URP 14.0.4, AR Foundation 5.0.2

    Now in 2022.2 AR Session Origin is Deprecated, however even if switching out the components for the newer XR Origin, I still get a black background, and like I say this is true with upgrading the project or just creating it new from scratch.

    So 1st, here's the setting for the older Unity, where things work fine:
    upload_2022-12-11_16-48-59.png

    upload_2022-12-11_16-49-30.png

    upload_2022-12-11_16-50-1.png

    upload_2022-12-11_16-50-36.png

    upload_2022-12-11_16-51-13.png
     
  2. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    And here, the newer version, where the build had a black/blank screen:

    upload_2022-12-11_16-52-43.png

    upload_2022-12-11_16-53-18.png

    upload_2022-12-11_16-53-47.png

    upload_2022-12-11_16-54-14.png

    upload_2022-12-11_16-55-2.png
     
  3. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    As you can see, the setting are identical in both projects, except of course the older one use AR Session Origin and the newer use XR Origin.

    Again, even if not upgrading, but doing everything from scratch in newer versions, I get black screen with only cube visible in cam feed after build. In the newer version, redoing project straight into AR Foundation 5.0.3, results in same issue.

    This is easily reproducable and dont need a bug submission I think.
     
  4. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Tried also with 2023.1 alpha and URP 15 and AR Foundation 5.1.0-pre 2, same thing

    When I get time, I will also try with built-in pipeline to see if its perhap's URP 14.0.4 upwards giving the issue...
     
    Last edited: Dec 13, 2022
  5. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Now tried 2022.2.0f1, AR Foundation 5.0.03, built in pipeline, and this WORKS!

    That seems to suggest something is broken in URP 14.0.4, and 15 then...
     
    Last edited: Dec 13, 2022
  6. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Yes, installed URP 14.0.4 and then:
    converted the scene using this
    upload_2022-12-12_17-28-18.png

    then added the AR Background Renderer to my chosen quality level URP forward render as so:
    upload_2022-12-12_17-29-6.png


    Build the project and then again, black screen for cam feed. This seems to confirm something is wrong in URP 14.0.4 upward when using in conjunction with AR Foundation 5.0.3 upwards...

    Can somebody else confirm please?
    @davidmo_unity
    @andyb-unity
     
    Last edited: Dec 13, 2022
  7. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,023
    I answered this in another thread, but reposting here for others:

    Yes unfortunately there is a longstanding bug in URP 14 and up where AR camera backgrounds render solid black. This is fixed in the most recent patch of URP 14 and will be available in a forthcoming Editor release: Unity 2022.2.2f1.

    In the meantime you can work around this issue by changing your AR Camera Manager's background rendering mode to After Opaques as explained here: https://docs.unity3d.com/Packages/c...ramanager-and-xrcamerabackgroundrenderingmode
     
    ROBYER1 and newguy123 like this.
  8. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    1,450
    In Unity 2022.2.1f1 using URP 14.0.4 and AR Foundation 5.0.3, using your fix worked for builds but not for XR Simulation in Editor, which was able to render the XR Simulation environment but not any 3d objects in the current scene despite me putting a cube in front of the camera to test. Have your team checked that? I am rolling up to 2022.2.3f1 to see if it is fixed there as we speak.

    Edit: It now works in 2022.2.3f1: https://forum.unity.com/threads/ar-...ackground-not-rendering.1302213/#post-8758309
     
    Last edited: Jan 26, 2023
    andyb-unity and newguy123 like this.
  9. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,023
    @ROBYER1 We have a fix in the upcoming 5.0.4 patch for the AfterOpaques setting in XR Simulation. The XR Simulation background shader in 5.0.3 has an incorrect ZTest value
     
    ROBYER1 and newguy123 like this.