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

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:

And here, the newer version, where the build had a black/blank screen:

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.

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…

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…

Yes, installed URP 14.0.4 and then:
converted the scene using this
8654580--1164939--upload_2022-12-12_17-28-18.png

then added the AR Background Renderer to my chosen quality level URP forward render as so:
8654580--1164942--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
@davidmo_unity

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: Migration guide | AR Foundation | 5.0.7

2 Likes

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://discussions.unity.com/t/886384/13

2 Likes

@ROBYER1_1 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

2 Likes