Skip to content

Commit 028b016

Browse files
authored
Add OpenXR "render from PV cam" note (#11127)
* Add info boxes about PV cam on OpenXR * Update URLs * Add helpboxes about the OpenXR behavior
1 parent 287a91b commit 028b016

File tree

3 files changed

+41
-7
lines changed

3 files changed

+41
-7
lines changed

Assets/MRTK/Providers/OpenXR/Editor/MRTK.OpenXR.Editor.asmdef

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"rootNamespace": "Microsoft.MixedReality.Toolkit.XRSDK.OpenXR.Editor",
44
"references": [
55
"Microsoft.MixedReality.Toolkit",
6+
"Microsoft.MixedReality.Toolkit.Editor.Utilities",
67
"Microsoft.MixedReality.Toolkit.Editor.Inspectors",
78
"Microsoft.MixedReality.Toolkit.Providers.OpenXR"
89
],
@@ -17,6 +18,12 @@
1718
"defineConstraints": [
1819
"UNITY_2020_2_OR_NEWER"
1920
],
20-
"versionDefines": [],
21+
"versionDefines": [
22+
{
23+
"name": "com.microsoft.mixedreality.openxr",
24+
"expression": "",
25+
"define": "MSFT_OPENXR"
26+
}
27+
],
2128
"noEngineReferences": false
2229
}

Assets/MRTK/Providers/OpenXR/Editor/OpenXRCameraSettingsProfileInspector.cs

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ public class OpenXRCameraSettingsProfileInspector : BaseMixedRealityToolkitConfi
1414
{
1515
private const string ProfileTitle = "OpenXR Camera Settings";
1616
private const string ProfileDescription = "";
17-
18-
private SerializedProperty reprojectionMethod;
17+
private const string DepthReprojectionDocURL = "https://docs.microsoft.com/windows/mixed-reality/hologram-stability#reprojection";
1918

2019
private static readonly GUIContent ReprojectionMethodTitle = new GUIContent("HoloLens 2 Reprojection Method");
20+
private static GUIContent mrcSettingsButtonContent = null;
2121

22-
private const string DepthReprojectionDocURL = "https://docs.microsoft.com/windows/mixed-reality/hologram-stability#reprojection";
22+
private SerializedProperty reprojectionMethod;
2323

2424
protected override void OnEnable()
2525
{
@@ -35,6 +35,32 @@ public override void OnInspectorGUI()
3535
{
3636
serializedObject.Update();
3737

38+
EditorGUILayout.HelpBox("Render from PV camera is now enabled by default when running with the Mixed Reality OpenXR Plugin. " +
39+
"It can be turned off from the \"Mixed Reality Features\" settings in the OpenXR plug-in settings. " +
40+
"Look for \"Disable First Person Observer\".", MessageType.Info);
41+
42+
#if MSFT_OPENXR
43+
mrcSettingsButtonContent ??= new GUIContent()
44+
{
45+
image = EditorGUIUtility.IconContent("Settings").image,
46+
text = " OpenXR plug-in settings",
47+
};
48+
49+
using (new EditorGUILayout.HorizontalScope())
50+
{
51+
GUILayout.FlexibleSpace();
52+
// The settings button should always be enabled.
53+
using (new GUIEnabledWrapper())
54+
{
55+
if (GUILayout.Button(mrcSettingsButtonContent, EditorStyles.miniButton, GUILayout.MaxWidth(250f)))
56+
{
57+
SettingsService.OpenProjectSettings("Project/XR Plug-in Management/OpenXR");
58+
}
59+
}
60+
GUILayout.FlexibleSpace();
61+
}
62+
#endif
63+
3864
EditorGUILayout.Space();
3965
using (new EditorGUILayout.HorizontalScope())
4066
{

Assets/MRTK/Providers/WindowsMixedReality/Shared/Editor/WindowsMixedRealityCameraSettingsProfileInspector.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ public class WindowsMixedRealityCameraSettingsProfileInspector : BaseMixedRealit
2222
private static readonly GUIContent PVCameraRenderingTitle = new GUIContent("Render from PV Camera (Align holograms)");
2323
private static readonly GUIContent ReprojectionMethodTitle = new GUIContent("HoloLens 2 Reprojection Method");
2424

25-
private const string MRCDocURL = "https://docs.microsoft.com/windows/mixed-reality/mixed-reality-capture-for-developers#render-from-the-pv-camera-opt-in";
26-
private const string DepthReprojectionDocURL = "https://docs.microsoft.com/windows/mixed-reality/hologram-stability#reprojection";
27-
private const string ReadingModeDocURL = "https://docs.microsoft.com/en-us/hololens/hololens2-display#what-improvements-are-coming-that-will-improve-hololens-2-image-quality";
25+
private const string MRCDocURL = "https://learn.microsoft.com/windows/mixed-reality/develop/advanced-concepts/mixed-reality-capture-overview#render-from-the-pv-camera-opt-in";
26+
private const string DepthReprojectionDocURL = "https://learn.microsoft.com/windows/mixed-reality/develop/advanced-concepts/hologram-stability#reprojection";
27+
private const string ReadingModeDocURL = "https://learn.microsoft.com/hololens/hololens2-display#what-improvements-are-coming-that-will-improve-hololens-2-image-quality";
2828

2929
protected override void OnEnable()
3030
{
@@ -52,6 +52,7 @@ public override void OnInspectorGUI()
5252

5353
EditorGUILayout.HelpBox("On legacy XR, render from PV camera is supported in Unity 2018.4.35f1 and newer if using Unity 2018 and Unity 2019.4.26f1 and newer if using Unity 2019.", MessageType.Info);
5454
EditorGUILayout.HelpBox("On Windows XR Plugin, render from PV camera is supported in versions 2.8.0, 4.5.0, and 5.3.0 (and newer in each respective major version).", MessageType.Info);
55+
EditorGUILayout.HelpBox("This checkbox is ignored on OpenXR and is now enabled by default when running with the Mixed Reality OpenXR Plugin. See the OpenXR Camera Settings profile for more info.", MessageType.Info);
5556
EditorGUILayout.PropertyField(renderFromPVCameraForMixedRealityCapture, PVCameraRenderingTitle);
5657

5758
EditorGUILayout.Space();

0 commit comments

Comments
 (0)