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

Case: 1363109

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

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.

1 Like

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.

XRSystem.ReleaseFrame() was not called!
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
NullReferenceException: Object reference not set to an instance of an object
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)
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)
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)
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)
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)
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)
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)
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)
UnityEngine.Rendering.RenderPipeline.InternalRender (UnityEngine.Rendering.ScriptableRenderContext context, UnityEngine.Camera[] cameras) (at <acc21e65c0ae4adf80ac80bfa5d3f603>:0)
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)
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.

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.

1 Like

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.

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.

1 Like