Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions com.valvesoftware.openxr.utils/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## [1.0.3] - 2026-02-12
### Added
- System info sample for checking device is Steam Frame
- Minor fixes/additions to documentation and OpenXR feature validation rules.

## [1.0.2] - 2026-01-14
### Fixed
- Fixed app permissions preventing gaze-based foveated rendering from being enabled.
Expand Down
11 changes: 11 additions & 0 deletions com.valvesoftware.openxr.utils/Documentation~/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,17 @@ git@github.com:ValveSoftware/Unity.git?path=com.valvesoftware.openxr.utils
| :--- | :--- |
| **Steam Frame Controller** | Interaction profile for Steam Frame controllers. |

## Samples

| **Name** | **Description** | **Requirements**
| :--- | :--- | :--- |
| **Refresh Rate** | Queries and displays the current display refresh rate. | Valve Utils Refresh Rate OpenXR Feature |
| **System Info** | Queries whether the device is Steam Frame using OpenXR's system info. | Unity 2022.3, Unity OpenXR Plugin v1.9.1 |

## Limitations

* Foveated rendering on Steam Frame under Unity 2022.3 may not render correctly when MSAA is enabled.

## Support

For bugs or features requests, open up a new issue if you don't see it addressed in the existing / closed issues.
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
using System;
using System.Collections.Generic;
using Unity.XR.Management.AndroidManifest.Editor;
using UnityEditor.Build.Reporting;
using UnityEditor.XR.OpenXR.Features;
using UnityEngine.XR.OpenXR;

namespace Valve.OpenXR.Utils.Editor
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using UnityEditor.Build.Reporting;
using UnityEditor.XR.OpenXR.Features;
using UnityEngine;
using UnityEngine.XR.OpenXR;

namespace Valve.OpenXR.Utils.Editor
{
Expand All @@ -16,6 +17,7 @@ internal class ValveOpenXRRenderRegionsFeatureBuildHooks : OpenXRFeatureBuildHoo

protected override void OnPreprocessBuildExt(BuildReport report)
{
ApplySettingsOverride();
}

protected override void OnProcessBootConfigExt(BuildReport report, BootConfigBuilder builder)
Expand Down Expand Up @@ -43,5 +45,13 @@ protected override void OnPostGenerateGradleAndroidProjectExt(string path)
protected override void OnPostprocessBuildExt(BuildReport report)
{
}

private void ApplySettingsOverride()
{
var openXrSettings = OpenXRSettings.GetSettingsForBuildTargetGroup(BuildTargetGroup.Android);
var target = EditorUtils.GetFeatureAsset<ValveOpenXRRenderRegionsFeature>();
target.ApplySettingsOverride(openXrSettings);
AssetDatabase.SaveAssetIfDirty(openXrSettings);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,8 @@ public override void OnInspectorGUI()

OpenXRSettings androidOpenXRSettings = OpenXRSettings.GetSettingsForBuildTargetGroup(BuildTargetGroup.Android);
var serializedOpenXrSettings = new SerializedObject(androidOpenXRSettings);

androidOpenXRSettings.symmetricProjection = symmetricProjection.boolValue;
#if UNITY_6000_1_OR_NEWER
androidOpenXRSettings.multiviewRenderRegionsOptimizationMode = (OpenXRSettings.MultiviewRenderRegionsOptimizationMode)multiviewRenderRegionsOptimizationMode.intValue;
#endif
((ValveOpenXRRenderRegionsFeature)target).ApplySettingsOverride(androidOpenXRSettings);
serializedOpenXrSettings.ApplyModifiedProperties();

EditorGUIUtility.labelWidth = 0.0f;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using System;
using UnityEditor;
using UnityEditor.Build.Reporting;
using UnityEditor.XR.OpenXR.Features;
using UnityEngine;
using UnityEngine.XR.OpenXR;

namespace Valve.OpenXR.Utils.Editor
{
Expand All @@ -15,7 +17,11 @@ internal class ValveOpenXRSupportBuildHooks : OpenXRFeatureBuildHooks

protected override void OnPostGenerateGradleAndroidProjectExt(string path) {}
protected override void OnPostprocessBuildExt(BuildReport report) {}
protected override void OnPreprocessBuildExt(BuildReport report) {}

protected override void OnPreprocessBuildExt(BuildReport report)
{
ApplySettingsOverride();
}

protected override void OnProcessBootConfigExt(BuildReport report, BootConfigBuilder builder)
{
Expand All @@ -29,5 +35,13 @@ protected override void OnProcessBootConfigExt(BuildReport report, BootConfigBui
builder.SetBootConfigValue(kLateLatchingSupported, item.lateLatchingMode ? "1" : "0");
builder.SetBootConfigValue(kLateLatchingDebug, item.lateLatchingDebug ? "1" : "0");
}

private void ApplySettingsOverride()
{
var openXrSettings = OpenXRSettings.GetSettingsForBuildTargetGroup(BuildTargetGroup.Android);
var target = EditorUtils.GetFeatureAsset<ValveOpenXRSupportFeature>();
target.ApplySettingsOverride(openXrSettings);
AssetDatabase.SaveAssetIfDirty(openXrSettings);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ public override void OnInspectorGUI()
EditorGUILayout.PropertyField(lateLatchingModeProp, s_lateLatchingModeLabel);
EditorGUILayout.PropertyField(lateLatchingDebugProp, s_lateLatchingDebugLabel);
EditorGUIUtility.labelWidth = 0.0f;

serializedObject.ApplyModifiedProperties();

OpenXRSettings androidOpenXRSettings = OpenXRSettings.GetSettingsForBuildTargetGroup(BuildTargetGroup.Android);
var serializedOpenXrSettings = new SerializedObject(androidOpenXRSettings);
androidOpenXRSettings.optimizeBufferDiscards = optimizeBufferDiscardsProp.boolValue;
((ValveOpenXRSupportFeature)target).ApplySettingsOverride(androidOpenXRSettings);
serializedOpenXrSettings.ApplyModifiedProperties();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,11 @@ public bool GetFoveationEyeTrackedCenter(ref Vector2 leftEye, ref Vector2 rightE
}

#if UNITY_EDITOR
protected override void GetValidationChecks(List<OpenXRFeature.ValidationRule> results, BuildTargetGroup target)
protected override void GetValidationChecks(List<OpenXRFeature.ValidationRule> rules, BuildTargetGroup targetGroup)
{
results.Add(new ValidationRule(this)
base.GetValidationChecks(rules, targetGroup);

rules.Add(new ValidationRule(this)
{
message = "This feature is only supported on Vulkan graphics API.",
error = true,
Expand All @@ -211,14 +213,37 @@ protected override void GetValidationChecks(List<OpenXRFeature.ValidationRule> r
fixItMessage = "Set Vulkan as Graphics API"
});

#if UNITY_2023_2_OR_NEWER
rules.Add(new ValidationRule(this)
{
message = "This feature requires the foveated rendering API set to SRP foveation.",
error = true,
checkPredicate = () =>
{
var settings = OpenXRSettings.GetSettingsForBuildTargetGroup(targetGroup);
if (settings)
{
return settings.foveatedRenderingApi == OpenXRSettings.BackendFovationApi.SRPFoveation;
}
return true;
},
fixIt = () =>
{
var settings = OpenXRSettings.GetSettingsForBuildTargetGroup(targetGroup);
settings.foveatedRenderingApi = OpenXRSettings.BackendFovationApi.SRPFoveation;
},
fixItAutomatic = true,
fixItMessage = "Set SPR foveation as the foveated rendering API."
});
#endif
#if UNITY_6000_0_OR_NEWER
results.Add(new ValidationRule(this)
rules.Add(new ValidationRule(this)
{
message = "Unity Foveated Rendering feature must be enabled.",
error = true,
checkPredicate = () =>
{
var settings = OpenXRSettings.GetSettingsForBuildTargetGroup(target);
var settings = OpenXRSettings.GetSettingsForBuildTargetGroup(targetGroup);
if (settings == null)
return false;

Expand All @@ -227,7 +252,7 @@ protected override void GetValidationChecks(List<OpenXRFeature.ValidationRule> r
},
fixIt = () =>
{
var settings = OpenXRSettings.GetSettingsForBuildTargetGroup(target);
var settings = OpenXRSettings.GetSettingsForBuildTargetGroup(targetGroup);
if (settings != null)
{
var foveationFeature = settings.GetFeature<FoveatedRenderingFeature>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using UnityEngine;
using UnityEngine.XR.OpenXR.Features;
using UnityEngine.XR.OpenXR.Features.MetaQuestSupport;
using UnityEngine.XR.OpenXR;
using UnityEngine.XR.OpenXR.NativeTypes;
#if UNITY_EDITOR
using UnityEditor;
using UnityEditor.XR.OpenXR.Features;
Expand Down Expand Up @@ -37,6 +32,8 @@ public class ValveOpenXRLeptonValidationFeature : OpenXRFeature
#if UNITY_EDITOR
protected override void GetValidationChecks(List<ValidationRule> rules, BuildTargetGroup targetGroup)
{
base.GetValidationChecks(rules, targetGroup);

var highestMinAndroidApiLevel = AndroidSdkVersions.AndroidApiLevel30;
rules.Add(new ValidationRule(this)
{
Expand Down
Loading