I just started using Unity 2019.3.3f1 with the new XR Plugin Manager. I have a Samsung Mixed Reality Headset that I am developing on and can only get the scene to render in the left eye. I am using the Universal Render Pipeline and have upgraded all the shaders to the Universal Render Pipeline/Lit version. I also created some new objects with a new material with the same shader, and that does not render in the right eye either. The only options I have under the Project Settings for the Mixed Reality is the Depth Buffer and shared Depth Buffer. I cannot change from Single Pass to Multi Pass. I believe it defaults to Single Pass. Is there a setting I am missing or something I need to set in code?
Hi @DanBHas, Could you double-check your shader has proper XR macros? WMR in URP is using single pass instanced. So I would recommend to check this: https://docs.unity3d.com/Manual/SinglePassInstancing.html
Hi Thomas, Yes all the macros are included in the LitForwardPass.hlsl, except for UNITY_INITIALIZE_OUTPUT. This is the default URP Lit shader. Is there a reason that it would not be using forward pass? This is the section of the shader that the included HLSL is in.
I've tried the debugging shader in the link you gave me and still no right eye. Also I am using XR Manager 3.0.6 and Windows XR Plugin 2.0.4 preview.3 Code (CSharp): Shader "XR/StereoEyeIndexColor" { Properties { _LeftEyeColor("Left Eye Color", COLOR) = (0,1,0,1) _RightEyeColor("Right Eye Color", COLOR) = (1,0,0,1) } SubShader { Tags { "RenderType" = "Opaque" } Pass { CGPROGRAM #pragma vertex vert #pragma fragment frag float4 _LeftEyeColor; float4 _RightEyeColor; #include "UnityCG.cginc" struct appdata { float4 vertex : POSITION; UNITY_VERTEX_INPUT_INSTANCE_ID }; struct v2f { float4 vertex : SV_POSITION; UNITY_VERTEX_INPUT_INSTANCE_ID UNITY_VERTEX_OUTPUT_STEREO }; v2f vert (appdata v) { v2f o; UNITY_SETUP_INSTANCE_ID(v); UNITY_INITIALIZE_OUTPUT(v2f, o); UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); o.vertex = UnityObjectToClipPos(v.vertex); return o; } fixed4 frag (v2f i) : SV_Target { UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); return lerp(_LeftEyeColor, _RightEyeColor, unity_StereoEyeIndex); } ENDCG } } }
Hi @DanBHas Thanks for getting back to me. The shader code you posted looks fine besides not using URP shader include. May I ask which URP version you are using? If you are using URP 7.2.1, then please submit a bug and I will take a look as soon as I can. Thanks Thomas
I was using 7.2.1, and I just tried 7.1.8 as well, but nether worked. It seems like the Standard renderer doesn't work with this XR system.
I just tried going back to the old VR system under player settings and I have a similar problem with the URP. This time the right eye is black instead of showing the background color of the camera. I'm back to the built-in renderer with the old VR system and everything works fine there. I'll submit this as a bug, but I haven't seen anyone else with this problem on the Windows Mixed Reality that couldn't solve it.
I'm having the same problem with HDRP+XRSDK. In single pass mode, all non-HDRP shaders (including unity built in like UI/Default) only render in left eye. HDRP shaders like HDRP/Lit and Unlit work fine. ShaderGraph based shaders that use lit or unlit output nodes work fine. Also for some reason the headset is way darker than the screen mirror. Samsung Odyssey HMD (not plus). 2019.3.5, SRP 7.2.1, all of the latest XR related packages in the package manager. Tried with stable and preview packages.
I'm seeing a similar issue, using the Built-in RP. 2019.3.9f1 Windows Plugin 2.0.3 XR Plugin Management 3.2.6 In my case, I've a custom Transparent shader applied to a sphere around the camera to create fade-in/out. Only the left eye is affected by the fade out. Is it possible this is a flavor of issue 1225548?
My system is only rendering the left eye as well. Samsung Odyssey +, unity 2019.4.1f1 with XR plugin.
Were you able to solve it, we are experiencing the same problem, without changing anything one day it started this problem, and even going back in the repository history we can get this bug fixed
The "left eye" problems I was having at that time were eventually fixed by various updates to unity and HDRP. Sorry I can't remember which version exactly. We're on unity 2022.1 branch and HDRP 13.1.8. The "dark headset" problem wasn't fixed until we switched from WindowsMR/Oculus packages to OpenXR. If the problem happened suddenly, consider blowing away the `Library` directory and do a full reimport. Some of my cohorts have recently had signs of incompatible shaders getting "stuck" in their build cache. IIRC, the left eye problem had to do with shaders not looking in the right place for the right-eye matrix created by HDRP.
We were able to fix our problem by going to ProjectSettings > GraphicsSettings and the field where the SRP asset should be (the first field) appeared as "None" although we were using the SRP without problems, we just put the SRP in there and nothing changes because internally stills assigned or something like that but then after restarting Unity after doing that, everything started working correctly, and legacy shaders were visible with the 2 eyes again