Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice
  2. Read here for Unity's latest plans on OpenXR.
    Dismiss Notice

Help Wanted NotImplementedException: Invalid XR setup for single-pass, trying to add too many views!

Discussion in 'AR/VR (XR) Discussion' started by xofreshxo, Aug 21, 2020.

  1. xofreshxo

    xofreshxo

    Joined:
    Apr 12, 2017
    Posts:
    63
    I have started getting this error every frame in one of the scenes for my VR game. Nothing changed in my code or the scene, just toward the end of my work day as I was in the middle of testing, I started getting this error anytime I wanted to turn on the camera for my headset.

    I'm using the OpenVR plugin, SteamVR asset package (version 2.6.1), HTC Vive Cosmos.

    If I go to other scenes, I don't receive this error. If I remove everything from my scene and just try to instantiate the "Player" prefab (has camera attached) from the SteamVR assets, I get this error. If I'm in another scene and instantiate the "Player" prefab, no problems. I have turned off and turned on my headset and restarted my computer multiple times. I'm not really sure what to do at this point.

    I'm also receiving an alert every frame that says: "If you're trying to enable XR single-pass after the first frame, you need to set TextureXR.maxViews to 2 before the render pipeline is created (typically in a script with Awake())."

    The full error details:
    NotImplementedException: Invalid XR setup for single-pass, trying to add too many views! Max supported: 1
    UnityEngine.Rendering.HighDefinition.XRPass.AddViewInternal (UnityEngine.Rendering.HighDefinition.XRView xrView) (at Library/PackageCache/com.unity.render-pipelines.high-definition@7.4.1/Runtime/RenderPipeline/XR/XRPass.cs:208)
    UnityEngine.Rendering.HighDefinition.XRPass.AddView (UnityEngine.XR.XRDisplaySubsystem+XRRenderPass xrSdkRenderPass, UnityEngine.XR.XRDisplaySubsystem+XRRenderParameter xrSdkRenderParameter) (at Library/PackageCache/com.unity.render-pipelines.high-definition@7.4.1/Runtime/RenderPipeline/XR/XRPass.cs:184)
    UnityEngine.Rendering.HighDefinition.XRSystem.CreateLayoutFromXrSdk (UnityEngine.Camera camera, System.Boolean singlePassAllowed) (at Library/PackageCache/com.unity.render-pipelines.high-definition@7.4.1/Runtime/RenderPipeline/XR/XRSystem.cs:298)
    UnityEngine.Rendering.HighDefinition.XRSystem.SetupFrame (UnityEngine.Camera[] cameras, System.Boolean singlePassAllowed, System.Boolean singlePassTestModeActive) (at Library/PackageCache/com.unity.render-pipelines.high-definition@7.4.1/Runtime/RenderPipeline/XR/XRSystem.cs:155)
    UnityEngine.Rendering.HighDefinition.HDRenderPipeline.Render (UnityEngine.Rendering.ScriptableRenderContext renderContext, UnityEngine.Camera[] cameras) (at Library/PackageCache/com.unity.render-pipelines.high-definition@7.4.1/Runtime/RenderPipeline/HDRenderPipeline.cs:1260)
    UnityEngine.Rendering.RenderPipeline.InternalRender (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Camera[] cameras) (at <23a7799da2e941b88c6db790c607d655>:0)
    UnityEngine.Rendering.RenderPipelineManager.DoRenderLoop_Internal (UnityEngine.Rendering.RenderPipelineAsset pipe, System.IntPtr loopPtr, Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle safety) (at <23a7799da2e941b88c6db790c607d655>:0)
    UnityEngine.GUIUtility: ProcessEvent(Int32, IntPtr)
     
    Vegaplanet33 likes this.
  2. CreaTech

    CreaTech

    Joined:
    May 29, 2017
    Posts:
    5
    If you get this issue, try saving your scene then running it again. I get this too also with SteamVR plugin as well as leap motion plugin, and saving scene seems to resolve it.
     
  3. Magasenakwa

    Magasenakwa

    Joined:
    Oct 13, 2018
    Posts:
    79
    In my case I have only one scene and it happens as soon as I enable XR via code. Does anyone know WHERE the TextureXR.maxViews is that we need to set? Googling it just leads me to this page :(
     
  4. CreaTech

    CreaTech

    Joined:
    May 29, 2017
    Posts:
    5
    Is this only when you are in the editor play mode? or also when you make a build?
    In my case I just save the save every time before I press play, even if i didnt make any changes to the scene. That resolves it for me. Its like something is not released from the previous play session, or something is marked as dirty but not updated.

    Try saving your scene, before you press play. Hopefully it works for you too
     
  5. anjiale

    anjiale

    Joined:
    Aug 12, 2020
    Posts:
    2
    Hi ! I also met the same problem after packing. How did I solve it
     
  6. RoaBen

    RoaBen

    Joined:
    Feb 13, 2019
    Posts:
    5
    is there a solution to this?
     
  7. Vegaplanet33

    Vegaplanet33

    Joined:
    Jan 26, 2019
    Posts:
    14
    I have the same issue. Any solutions? Saving my scene doesn't help..
     
  8. fabien-unity

    fabien-unity

    Unity Technologies

    Joined:
    Oct 17, 2018
    Posts:
    60
    Hi,

    You can find TextureXR inside the namespace UnityEngine.Rendering : https://docs.unity3d.com/Packages/c...@7.4/api/UnityEngine.Rendering.TextureXR.html

    So either fully specify your code with :
    Code (CSharp):
    1. UnityEngine.Rendering.TextureXR.maxViews = 2;
    Or just add this on top of your script :
    Code (CSharp):
    1. using UnityEngine.Rendering;
    I'll take note to edit the documentation to make this clearer. Sorry for the confusion.
    Let me know if it resolves your issue.

    Fabien
     
  9. Unity_gamer

    Unity_gamer

    Joined:
    Aug 19, 2011
    Posts:
    30
    I'm also getting similar error,
    As mentioned above by @fabien-unity I have tried adding
    Code (CSharp):
    1. UnityEngine.Rendering.TextureXR.maxViews = 2;
    in the awake, Now I'm getting a different error
    Along with this I'm getting one warning
    I'm using OpenVR with Vive pro and Unity version 2020.2.2.

    In my case I'm having the single instance selected by default, not changing/Setting it runtime. Not sure about the cause of this issue and what more strange is, The first exception I get once in a while and it goes away some times. Its really annoying to find these kind of problems.

    I had a look in to the SteamVR forum , but did'nt find any help.

    I hope there will be some fix available for this.

    Thanks!
     
    Last edited: Feb 28, 2021
  10. sgthale

    sgthale

    Joined:
    Mar 10, 2018
    Posts:
    7
    You can try disabling all kinds of Post Processing in the HDRP you are using. Unfortunately it doesn't seem like it will work properly for now. Also make sure to do the texture maxViews=2 at the very BEGINNING of your project, not when you initialize VR.
     
unityunity