Search Unity

Question No Camera - Black Screen Issue

Discussion in 'Unity MARS' started by LucasRizzotto, Aug 6, 2020.

  1. LucasRizzotto

    LucasRizzotto

    Joined:
    Dec 11, 2015
    Posts:
    27
    Not sure what's going on, but about 50% of the time I put MARS in a project I can expect my project's camera to stop working randomly, forcing me to create a project from scratch to "fix" the issue.

    I'm using the URP and support says that I should "ensure that the AR Background Renderer Feature" is enabled, but this is only available in ARKit 3.0 forward, which doesn't seem to be verified.

    I have a Default Island set in FunctionalityInjectionModule and the ARKit plugin is properly installed. What should I do?

    Edit: Added the AR Background Renderer and the issue is still present.
     
    Last edited: Aug 6, 2020
  2. CiaranWills

    CiaranWills

    Unity Technologies

    Joined:
    Apr 24, 2020
    Posts:
    199
    Did you create your project from the URP template? Also you will need to update your AR Foundation packages to at least version 3.0 to work with URP (this is probably why you don't see the AR Background Renderer Feature as available, but it does work in 2019)

    Find the ForwardRenderer asset (probably in Assets/Settings), click "Add Renderer Feature" and add the "AR Background Renderer Feature"

    Let us know if that fixes it. We're still working on a few rough edges with MARS and URP...
     
    sath likes this.
  3. LucasRizzotto

    LucasRizzotto

    Joined:
    Dec 11, 2015
    Posts:
    27
    @CiaranWills Hey! I updated the renderer + forward renderer and still have the same issue.
     
  4. LucasRizzotto

    LucasRizzotto

    Joined:
    Dec 11, 2015
    Posts:
    27
    Actually, removed URP entirely from the project and the issue still persists.
     
    Last edited: Aug 6, 2020
  5. mtschoen

    mtschoen

    Unity Technologies

    Joined:
    Aug 16, 2016
    Posts:
    194
    Do you see any errors or suspicious looking logs from the device? Are you testing on iOS or Android?
     
  6. CiaranWills

    CiaranWills

    Unity Technologies

    Joined:
    Apr 24, 2020
    Posts:
    199
    Do you have the ARKit provider checked in Project Settings -> XR Plug-in Management? I often forget this step when setting up a new project...
     
    wickedwaring likes this.
  7. martinreimer

    martinreimer

    Joined:
    Feb 21, 2018
    Posts:
    16
    Have the same issues with URP building an app where the camera wont activate. Ive created multiple projects trying to get it to work with URP in 2019.3 and 2019.4. No luck.

    Literally, the first project I create using standard render and it works correctly.
     
    shiftybit likes this.
  8. CiaranWills

    CiaranWills

    Unity Technologies

    Joined:
    Apr 24, 2020
    Posts:
    199
    Sorry to hear you are having issues. Black screens are pretty hard to debug but with a bit more info hopefully we can figure it out. If you can tell us:

    What platform are you building for (Android/ARCore, iOS/ARKit, other...)?
    What versions of the AR Foundation, ARCore/ARKit and URP packages do you have?
    Did you start the project from the URP template in the Unity Hub?
    And as mentioned above do you have the AR Background Render Feature added to the Forward Renderer?

    Another useful thing to try is just putting some geometry in front of the camera so you can tell if it's not rendering anything at all or just missing the background.
     
  9. jmunozarUTech

    jmunozarUTech

    Unity Technologies

    Joined:
    Jun 1, 2020
    Posts:
    297
    To complement Ciaran's answer;

    @martinreimer, (if you havent already) check the FAQ https://docs.unity3d.com/Packages/com.unity.mars@1.2/manual/FAQ.html where it says "I built my Scene to a device and all I see is a black screen. What went wrong?"

    That can get you started to diagnoze what's happening. Specially where it mentions the URP case (ensure that the AR Background Renderer Feature is added to your SRP configuration (generally onto the ForwardRenderer asset for URP projects)).
     
  10. Siyka

    Siyka

    Joined:
    Aug 17, 2014
    Posts:
    10
    Not using MARS, but with the latest AR packages, I get the error:

    You can only call cameraDepthTarget inside the scope of a ScriptableRenderPass. Otherwise the pipeline camera target texture might have not been created or might have already been disposed.

    Unity 2020.2.1f1, URP, when I build for iOS and try to use the ARBackgroundRendererFeature, The camera background stopped working, not possible to use AR.
     
  11. mtschoen

    mtschoen

    Unity Technologies

    Joined:
    Aug 16, 2016
    Posts:
    194
    Hi there! I assume by "not using MARS" you mean that you are seeing this issue with AR Foundation on its own? Could you please submit a bug using the Bug reporter, and ask on our AR forum?

    We will certainly help track this issue, but we need to get it in front of the right people :)
     
  12. ShodanIsAlive

    ShodanIsAlive

    Joined:
    Nov 18, 2015
    Posts:
    3
    Adding the New AR Background Renderer to the Forward Renderer solved my problem for good
    I'm using version 2020.1.6f1 with AR Foundation version 3.1.6

    In my opinion, this has to be added to the official documentation as I couldn't find it anywhere in the various tutorials and documentation or learn paths on Unity. Would have saved me a lot of time.
     
    wickedwaring likes this.
  13. mtschoen

    mtschoen

    Unity Technologies

    Joined:
    Aug 16, 2016
    Posts:
    194
    Thanks for the note. We will try to improve our documentation in the future.
     
    ShodanIsAlive likes this.