Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Black Screen

Discussion in 'Handheld AR' started by HEROTECH70, May 8, 2020.

  1. HEROTECH70

    HEROTECH70

    Joined:
    May 24, 2017
    Posts:
    29
    I am trying to add ARFoundation to an existing project, I downloaded the ARFoundationDemos project from the AssetStore and it worked fine in an empty project, If I try to set up the scene the same way as in the demo project I just get a black screen.

    One thing I noticed is that on the demo project it asks automatically for camera permission while on my project it doesn't. Even if I manually give permission the screen is still black (tried with the unity permission api too)

    Can anyone help please? I considered rebuilding the project from the demo project but it would take me far too long (this was an existing vuforia project but we decided to move to ARFoundation)
     
  2. todds_unity

    todds_unity

    Unity Technologies

    Joined:
    Aug 1, 2018
    Posts:
    147
  3. HEROTECH70

    HEROTECH70

    Joined:
    May 24, 2017
    Posts:
    29
    Yes I already followed those instructions, and then I tried to copy the setup from the demo projects provided.
    Since it still didn't work I decided to fire up Logcat and I noticed this warning

    2020/05/10 10:06:01.433 6877 6923 Warn Unity No active UnityEngine.XR.ARSubsystems.XRSessionSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.

    could you please update the "getting started" documentation to include this step? I re-read it multiple times to make sure I am not just an idiot and didn't see it but I think it's not there.

    To make it work you have to go into project settings XR Plug-in Management and select the XR plug-in providers you need for your project.
    Once I ticked ARCore the camera started working correctly.

    Edit:
    Nevermind, there is something in the existing project that is screwing things up bad.

    ARTrackedImageManager.trackedImagesChanged is never being called
    Although tracking is working
    Also I just noticed there is no TrackedPoseDriver attached to the AR Camera, only a generic ArPoseDriver script.
    The only way to get the right behaviour on it is to upgrade to ARFoundation 4.0
    I guess I will have to make a new project and slowly import everything in there.
     
    Last edited: May 10, 2020
    Tarrag and ganaware like this.
  4. todds_unity

    todds_unity

    Unity Technologies

    Joined:
    Aug 1, 2018
    Posts:
    147
    Thank you for pointing out that our documentation is lacking on the XR management steps in the Basic Setup guide.

    We are adding those details that should be available following the next release.
     
    hmkn, Tarrag and ganaware like this.
  5. _slash_

    _slash_

    Joined:
    Mar 26, 2013
    Posts:
    1
  6. Jelmer123

    Jelmer123

    Joined:
    Feb 11, 2019
    Posts:
    104
    EDIT: Solved by adding the XR interaction toolkit package.
    What is confusing with the documentation is that without the package, you still see the interface for the provider setup and you can select the provider. But without the package mentioned, the project doesn't work.
    I would suggest to explicitly say that you need to install the package?
    ----------

    Original post:
    Im also having these issues.I made many ARF projects before.
    But with ARF4:
    - I added the usual suspect: AR session and AR Session Origin from the XR menu, which (should) create the correct camera setup etc.
    In the Project Settings' XR plugin Management I selected ARKit.

    Still I get:
    InvalidOperationException: Could not find shader named 'Unlit/ARKitBackground' required for video overlay on camera subsystem. at UnityEngine.XR.ARSubsystems.XRCameraSubsystem+Provider.CreateCameraMaterial

    And:
    No active UnityEngine.XR.ARSubsystems.XRSessionSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.

    What could it be?
    Only I noticed that ARF is version 4.0.2, while ARKit plugin is 4.0.1 and that ARsubsystems is not shown in the package manager while it is installed.
     

    Attached Files:

    Last edited: Jun 20, 2020
    kamathamA likes this.
  7. art1997

    art1997

    Joined:
    Apr 7, 2017
    Posts:
    26
    HI . wanted to try ARF 4.1 for depth api for android. but have black screen.
    Any idea how to solve?
    Debug Message
    No active UnityEngine.XR.ARSubsystems.XRSessionSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.
     
    quangtqag and hmkn like this.
  8. todds_unity

    todds_unity

    Unity Technologies

    Joined:
    Aug 1, 2018
    Posts:
    147
  9. R42_Leon

    R42_Leon

    Joined:
    Feb 24, 2016
    Posts:
    21
    I was facing the same issue after upgrading from ARFoundation 3.1.0 (working fine) to 4.0 (aforementioned black screen issue & log error messages about no active UnityEngine.XR.ARSubsystems.XRSessionSubsystem being available).

    The fix was to add the XR interaction toolkit package as suggested by Jelmer123 (note that as of now the packed is in preview).

    I am confused as to whether that's needed - as far as I know that package should just include a collection of higher-level utilities to implement interaction patterns with objects (mostly in VR, nonetheless) and nothing "essential" for ARFoundation initialization?
     
unityunity