Search Issue Tracker

Fixed

Fixed in 6000.0.0b11

Votes

0

Found in

2021.3.33f1

2022.3.17f1

2023.2.6f1

2023.3.0b3

6000.0.0b11

Issue ID

UUM-60381

Regression

No

"Camera.main.stereoTargetEye = StereoTargetEyeMask.None" does not change the property of Camera's Target Eye if URP is present in the project

--

-

Steps to reproduce:
1. Open the attached user's project "VR Spectator.zip"
2. Select the "Main Camera" GameObject in the Hierarchy
3. Enter Play Mode and in the Inspector observe the value of Target Eye not changing to "None" via "ChanceCam.cs"
4. Navigate to Project Settings -> Graphics and remove URP rendering asset
5. Enter Play Mode and observe Target Eye value changing to "None" via "ChanceCam.cs"

Expected Result: "Camera.main.stereoTargetEye = StereoTargetEyeMask.None" does not change the property of Camera's Target Eye if URP is present in the project
Actual Result: "Camera.main.stereoTargetEye = StereoTargetEyeMask.None" does change the property of Target Eye regardless if URP is present in the project or not

Reproducible with: 2021.3.33f1, 2022.3.17f1, 2023.2.6f1, 2023.3.0b3

Testing Environment: Windows 11
Not reproducible on: No other environment tested

Notes:
-This works in BiRP, but does not work when using URP. This is because URP uses SpectatorCamera.GetUniversalAdditionalCameraData().allowXRRendering = false;

  1. Resolution Note (fix version 6000.0.0b11):

    The API to be used here is different in built-in render pipeline and URP. Setting `Camera.stereoTargetEye` in URP is not allowed, and there should be a warning when you try to set it with URP active. The warning isn't displayed correctly in your case when the property is set from a Start() event function - this will be fixed for 23.3.

    The corresponding API to use with URP is `Camera.GetUniversalAdditionalCameraData().allowXRRendering`, which is what "VR Spectator Camera" asset store package is doing (note that this is not Unity/URP code) - this appears to be correct.

    The confusion is likely caused by the fact that both of these fields are displayed in the UI with the label "Target Eye", but they correspond to different serialized data. This is due to backwards compatibility with built-in render pipeline.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.