Search Unity

Bug Hybrid with OpenXR pink mats(SRP) in VR play mode

Discussion in 'Graphics for ECS' started by Sab_Rango, Sep 5, 2021.

  1. Sab_Rango

    Sab_Rango

    Joined:
    Aug 30, 2019
    Posts:
    121
    Case: 1363109


    DOTS hybrid renderer is displaying pink materials during VR play mode when OpenXR was used.




    hybrid.png
     
  2. joelv

    joelv

    Unity Technologies

    Joined:
    Mar 20, 2015
    Posts:
    203
    XR is currently not supported with the hybrid renderer. It might work in some circumstances due to sheer luck but overall it is untested and unsupported.
    We will support XR platforms in future versions of the hybrid renderer, but exactly when that happens is undecided.
     
    CleverAI likes this.
  3. CleverAI

    CleverAI

    Joined:
    Jun 4, 2017
    Posts:
    38
    I am also at this point. Trying OpenXR 1.6.0 with Hybrid Renderer V2 0.50.0-previw.24 with Unity 2020.3.43f1 LTS and all I get are errors over errors and nothing except the UI get rendered at all.

    Code (CSharp):
    1. XRSystem.ReleaseFrame() was not called!
    2. UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. UnityEngine.Rendering.Universal.Internal.PostProcessPass.Render (UnityEngine.Rendering.CommandBuffer cmd, UnityEngine.Rendering.Universal.RenderingData& renderingData) (at Library/PackageCache/com.unity.render-pipelines.universal@10.10.1/Runtime/Passes/PostProcessPass.cs:402)
    3. UnityEngine.Rendering.Universal.Internal.PostProcessPass.Execute (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Rendering.Universal.RenderingData& renderingData) (at Library/PackageCache/com.unity.render-pipelines.universal@10.10.1/Runtime/Passes/PostProcessPass.cs:234)
    4. UnityEngine.Rendering.Universal.ScriptableRenderer.ExecuteRenderPass (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Rendering.Universal.ScriptableRenderPass renderPass, UnityEngine.Rendering.Universal.RenderingData& renderingData) (at Library/PackageCache/com.unity.render-pipelines.universal@10.10.1/Runtime/ScriptableRenderer.cs:754)
    5. UnityEngine.Rendering.Universal.ScriptableRenderer.ExecuteBlock (System.Int32 blockIndex, UnityEngine.Rendering.Universal.ScriptableRenderer+RenderBlocks& renderBlocks, UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Rendering.Universal.RenderingData& renderingData, System.Boolean submit) (at Library/PackageCache/com.unity.render-pipelines.universal@10.10.1/Runtime/ScriptableRenderer.cs:728)
    6. UnityEngine.Rendering.Universal.ScriptableRenderer.Execute (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Rendering.Universal.RenderingData& renderingData) (at Library/PackageCache/com.unity.render-pipelines.universal@10.10.1/Runtime/ScriptableRenderer.cs:583)
    7. UnityEngine.Rendering.Universal.UniversalRenderPipeline.RenderSingleCamera (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Rendering.Universal.CameraData cameraData, System.Boolean anyPostProcessingEnabled) (at Library/PackageCache/com.unity.render-pipelines.universal@10.10.1/Runtime/UniversalRenderPipeline.cs:390)
    8. UnityEngine.Rendering.Universal.UniversalRenderPipeline.RenderCameraStack (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Camera baseCamera) (at Library/PackageCache/com.unity.render-pipelines.universal@10.10.1/Runtime/UniversalRenderPipeline.cs:527)
    9. UnityEngine.Rendering.Universal.UniversalRenderPipeline.Render (UnityEngine.Rendering.ScriptableRenderContext renderContext, UnityEngine.Camera[] cameras) (at Library/PackageCache/com.unity.render-pipelines.universal@10.10.1/Runtime/UniversalRenderPipeline.cs:241)
    10. UnityEngine.Rendering.RenderPipeline.InternalRender (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Camera[] cameras) (at <acc21e65c0ae4adf80ac80bfa5d3f603>:0)
    11. UnityEngine.Rendering.RenderPipelineManager.DoRenderLoop_Internal (UnityEngine.Rendering.RenderPipelineAsset pipe, System.IntPtr loopPtr, System.Collections.Generic.List`1[T] renderRequests, Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle safety) (at <acc21e65c0ae4adf80ac80bfa5d3f603>:0)
    12. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
    Any new updates for Hybrid Renderer V2 and DOTS to support OpenXR?


    EDIT:
    After I restarted the Unity Editor those errors are gone, but still all entities will not be rendered. Only if I disable "Initialize XR on Startup" then everything goes back to normal as the VR is disabled of course.
    I've seen this behavior without VR before for my Linux builds too. Only Windows and Mac builds are rendering the entities correctly. So this really means that Hybrid Renderer still not supports OpenXR.
     
    Last edited: Jan 29, 2023
  4. Arnold_2013

    Arnold_2013

    Joined:
    Nov 24, 2013
    Posts:
    287
    Don't know if its 'supported', but it seems to work for me.

    I have OpenXR (on Windows PC) working with URP and Hybrid renderer V2 on DX11 from ECS-0.17 to the current (ECS 1.0-pre15). Both in Editor and in Build (using SteamVR as the runtime and Render mode Single Pass Instanced).

    *Edit: for version 1.0 they changed the package name of the hybrid renderer, but its otherwise the same beast.
     
    CleverAI likes this.
  5. CleverAI

    CleverAI

    Joined:
    Jun 4, 2017
    Posts:
    38
    Okay. Then I have to rather try it again on a completely new build than on my existing game and check if it works there for me. It could be that I have some very old settings from the beginning of ECS, which prevent it from rendering entities in VR, as I used it since February 2020 and only updated it to 0.50.0

    Is there any known setting in the hybrid renderer or OpenXR which prevent them from working together?

    EDIT:
    I see that there exist now an Entity Graphics Package instead of the Hybrid Renderer. I will try to update my Unity Editor 2020.3.43f1 to 2022.2.4f1 and all the ECS related components too. Let's see if my game still works after the update and then if OpenXR perhaps works as well. I'll make a backup of my game before of course.
     
    Last edited: Jan 29, 2023
  6. Arnold_2013

    Arnold_2013

    Joined:
    Nov 24, 2013
    Posts:
    287
    No not that I can remember. I think it just worked out of the box. You could try making a new project with the minimal amount of packages to see if it works. URP "Forward+" does not currently work with VR (its on the known issues list). I am using "Forward" URP (only allows 1 directional light, and no other lights).

    If you go from ECS [0.17, 0.50 or 0.51] to ECS 1.0 there are quite a lot of breaking changes, took me 2 weeks to get a 0.51 project to work in 1.0. Not really related to the VR part, just the normal ECS stuff.
     
    CleverAI likes this.