Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
## [1.12.0] - 2024-08-01

### Added

* Add class `MetaQuestTouchPlusControllerProfile.QuestTouchPlusController` interaction profile to support Meta Quest Touch Plus Controllers.
* Added a validation rule to warn you that soft shadows can negatively affect performance for Microsoft HoloLens.
* Added a validation rule to infrom you to make the OpenXR Loader an active loader in XR Plugin Management if there are active OpenXR features in the OpenXR settings.
* Added `OpenXRSettings.autoColorSubmissionMode` boolean property to specify OpenXR to use a platform-supported color format in the display swapchain, or for you to manually set which format should OpenXR to use.
* Added `OpenXRSettings.colorSubmissionModes` array property to control the color format used by the OpenXR display swapchain. The available options can be chosen from the `OpenXRSettings.ColorSubmissionModeGroup` enum. OpenXR will use supported color formats by the platform, starting from the first option in the list. In case none of the color formats supplied is supported by the platform, an error will be thrown. If no color formats are assigned, the format used will be RGBA32.
* Added `Automatic Color Submission Mode` toggle and `Color Submission Modes` list to the OpenXR project settings tab, allowing you to manually specify the preferred color format to be used by the display swapchain. OpenXR will use supported color formats by the platform, starting from the first option in the list. In case none of the color formats supplied is supported by the platform, an error will be thrown. If no color formats are assigned, the format used will be RGBA32.

### Fixed

* Fixed sort order of OpenXR features listed based first on priority, then by name, preventing spurious changes in Settings files.
  • Loading branch information
Unity Technologies committed Aug 1, 2024
1 parent 22a004f commit 845d256
Show file tree
Hide file tree
Showing 193 changed files with 1,806 additions and 3,816 deletions.
25 changes: 10 additions & 15 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
> **Notes**
> When updating the Changelog, please ensure we follow the standards for ordering headers as outlined here: [US-0039](https://standards.ds.unity3d.com/Standards/US-0039/). Specifically: Under ## headers, ### \<type\> headers are listed in this order: Added, Changed, Deprecated, Removed, Fixed, Security
-->
## [1.12.0] - 2024-08-01

## [1.12.0-exp.1] - 2024-06-28

### Fixed
* Fixed Custom Composition Layer Feature not showing up in the OpenXR feature setting UI after importing into project.
* Fixed a crash with composition layers in scene due to race condition.

### Changed
* Implements the construction and maintenance of native composition layers in C# via our LayerProvider classes inheriting from OpenXRCustomLayerHandler.
### Added

## [1.11.1-exp.1] - 2024-06-12
* Add class `MetaQuestTouchPlusControllerProfile.QuestTouchPlusController` interaction profile to support Meta Quest Touch Plus Controllers.
* Added a validation rule to warn you that soft shadows can negatively affect performance for Microsoft HoloLens.
* Added a validation rule to infrom you to make the OpenXR Loader an active loader in XR Plugin Management if there are active OpenXR features in the OpenXR settings.
* Added `OpenXRSettings.autoColorSubmissionMode` boolean property to specify OpenXR to use a platform-supported color format in the display swapchain, or for you to manually set which format should OpenXR to use.
* Added `OpenXRSettings.colorSubmissionModes` array property to control the color format used by the OpenXR display swapchain. The available options can be chosen from the `OpenXRSettings.ColorSubmissionModeGroup` enum. OpenXR will use supported color formats by the platform, starting from the first option in the list. In case none of the color formats supplied is supported by the platform, an error will be thrown. If no color formats are assigned, the format used will be RGBA32.
* Added `Automatic Color Submission Mode` toggle and `Color Submission Modes` list to the OpenXR project settings tab, allowing you to manually specify the preferred color format to be used by the display swapchain. OpenXR will use supported color formats by the platform, starting from the first option in the list. In case none of the color formats supplied is supported by the platform, an error will be thrown. If no color formats are assigned, the format used will be RGBA32.

### Fixed
* Fixed Metal API initialization.

* Fixed sort order of OpenXR features listed based first on priority, then by name, preventing spurious changes in Settings files.

## [1.11.0] - 2024-05-01

Expand Down Expand Up @@ -52,11 +52,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
* Fixed crash that occurs while cleaning up destroyed swapchains in OpenXR.
* Fixed Depth Texture flag disparity between the OpenXR and Oculus providers.

## [1.11.0-exp.1] - 2024-02-25

### Added
* Added XR Composition Layers support - Experimental. Install Composition Layer Experimental package - com.unity.xr.compositionlayers 0.5.0 to pair with.

## [1.10.0] - 2024-01-26

### Added
Expand Down
2 changes: 1 addition & 1 deletion ConformanceAutomation/android.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ConformanceAutomation/android/arm64.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ConformanceAutomation/android/x64.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ConformanceAutomation/osx.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified ConformanceAutomation/osx/ConformanceAutomationExt.dylib
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ConformanceAutomation/universalwindows.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ConformanceAutomation/universalwindows/arm32.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ConformanceAutomation/universalwindows/arm64.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ConformanceAutomation/universalwindows/x64.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ConformanceAutomation/windows.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ConformanceAutomation/windows/x64.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified ConformanceAutomation/windows/x64/ConformanceAutomationExt.dll
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions Documentation~/config.json

This file was deleted.

42 changes: 42 additions & 0 deletions Documentation~/features/metaquesttouchpluscontrollerprofile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
uid: openxr-meta-quest-plus-touch-controller-profile
---
# Meta Quest Touch Plus Controller Profile

Enables the OpenXR interaction profile for Meta Quest Touch Plus controllers and exposes the `<QuestTouchPlusController>` device layout within the [Unity Input System](https://docs.unity3d.com/Packages/com.unity.inputsystem@latest/).

## Available controls

| OpenXR Path | Unity Control Name | Type |
|----|----|----|
|`/input/thumbstick`| thumbstick | Vector2 |
|`/input/squeeze/value`| grip | Float |
|`/input/squeeze/value`| gripPressed | Boolean (float cast to boolean) |
|`/input/menu/click`| menu (Left Hand Only)| Boolean |
|`/input/system/click`| menu (Right Hand Only)| Boolean |
|`/input/a/click`| primaryButton (Right Hand Only) | Boolean |
|`/input/a/touch`| primaryTouched (Right Hand Only) | Boolean |
|`/input/b/click`| secondaryButton (Right Hand Only) | Boolean |
|`/input/b/touch`| secondaryTouched (Right Hand Only) | Boolean |
|`/input/x/click`| primaryButton (Left Hand Only) | Boolean |
|`/input/x/touch`| primaryTouched (Left Hand Only) | Boolean |
|`/input/y/click`| secondaryButton (Left Hand Only) | Boolean |
|`/input/y/touch`| secondaryTouched (Left Hand Only) | Boolean |
|`/input/trigger/value`| trigger | Float |
|`/input/trigger/value`| triggerPressed | Boolean (float cast to boolean) |
|`/input/trigger/touch`| triggerTouched| Boolean (float cast to boolean) |
|`/input/thumbstick/click`| thumbstickClicked | Boolean |
|`/input/thumbstick/touch`| thumbstickTouched | Boolean |
|`/input/thumbrest/touch`| thumbrestTouched | Boolean |
|`/input/grip/pose` | devicePose | Pose |
|`/input/aim/pose` | pointer | Pose |
|`/input/trigger/force` | triggerForce | Float |
|`/input/trigger/curl_meta` | triggerCurl | Float |
|`/input/trigger/slide_meta` | triggerSlide | Float |
|`/input/trigger/proximity_meta` | triggerProximity | Boolean |
|`/input/thumb_meta/proximity_meta` | thumbProximity | Boolean |
|`/output/haptic` | haptic | Vibrate |
| Unity Layout Only | isTracked | Flag Data |
| Unity Layout Only | trackingState | Flag Data |
| Unity Layout Only | devicePosition | Vector3 |
| Unity Layout Only | deviceRotation | Quaternion |
2 changes: 1 addition & 1 deletion Documentation~/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ OpenXR is an open, royalty-free standard developed by Khronos that aims to simpl

This version of OpenXR is compatible with the following versions of the Unity Editor:

* 2021 LTS+
* 2021.3 LTS+

## Runtimes

Expand Down
45 changes: 44 additions & 1 deletion Documentation~/project-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Some OpenXR features require specific Unity Project settings to function properl
* **[Enable the OpenXR XR plug-in](#enable-openxr)**: must be enabled to use OpenXR features.
* **[OpenXR features](#openxr-features)**: select the specific OpenXR features that you want to use.
* **[Render Mode](#render-mode)**: choose the rendering strategy.
* **[Color Submission Mode](#color-submission-mode)**: choose how color information is passed to the renderer.
* **[Depth Submission Mode](#depth-submission-mode)**: choose how depth information is passed to the renderer.
* **[Play Mode OpenXR Runtime](#openxr-runtime)** (Editor): choose which OpenXR plug-in to use when running in the Unity Editor Play mode.
* **[Interaction profiles](#interaction-profile)**: choose which OpenXR interaction profile to use for a platform.
Expand Down Expand Up @@ -95,6 +96,48 @@ For more information see:
* [Single Pass Instanced rendering](xref:SinglePassInstancing)


<a name="depth-submission-mode"></a>
### Set the color submission mode

Some OpenXR runtimes support rendering to additional swapchain formats, such as 10- or 16-bit
high-dynamic range (HDR). Alternately, some performance may be gained on some devices by choosing
lower fidelity as a trade-off. The available formats depend on both the Unity version you are using
and the device and runtime that the Player is run on.

*Auto Color Submission Mode* currently selects the default platforms which is typically an 8bpc RGBA/BGRA format.

|**Option**|**Description**|
|---|---|
|**8 bits per channel (LDR, default)**|The default 8bpc RGBA/BGRA format. Will use sRGB if supported and either default or selected in player API options (e.g. in GLES).|
|**10 bits floating-point per color channel, 2 bit alpha (HDR)**|Packed 10bpc unsigned normalized floating-point color with 2 bits of alpha depth.|
|**16 bits floating-point per channel (HDR)**|16bpc signed half-width floating point color/alpha.|
|**5,6,5 bit packed (LDR, mobile)**|Compact packed format typically only used on low performance mobile devices and low gamut displays.|
|**11,11,10 bit packed floating-point (HDR)**|Packed color-only format using 11bpc unsigned float for red and green channels and 10bpc for blue.|

The best choice depends on your use case, platform, and target devices. Larger HDR formats will
generally encounter lower performance especially on lower-spec hardware, but generally provide
better rendering integrity in scenes with high dynamic range or luminance gradients (where banding
may be noticeable in LDR formats).

Reasonable rules of thumb when choosing a setting:
* For PC XR devices, consider your target devices and choose a performant HDR setting if you need
HDR. This often depends on the graphics API, GPU, and XR device together, so it may require extra
performance testing.
* For mobile XR devices, HDR swapchains are generally unsupported. In most cases it's best to stick
to **Auto Color Submission Mode** or **8 bits per channel (LDR, default)**.

To set the color submission mode:

1. Open the **Project Settings** window (menu: **Edit &gt; Project Settings**).
2. Click **XR Plug-in Management** to expand the plug-in section (if necessary).
3. Select **OpenXR** in the list of XR plug-ins.
4. Select the tab for a platform build target to view the features for that target.
5. Uncheck **Auto Color Submission Mode**.
6. Choose the desired **Color Submission Mode**s and sort according to priority (the order the list
is in sets the priority; actual selection depends on graphics API and hardware support.)
**8 bits per channel (LDR, default)** can be reordered but cannot be removed; it is a safe
fallback.

<a name="depth-submission-mode"></a>
### Set the depth submission mode

Expand Down Expand Up @@ -221,4 +264,4 @@ Clicking on either the validation warning or the error icon brings up the Valida

![build-with-issues](images/ProjectValidation/build-with-issues.png)

Double-clicking on build warnings or errors from validation brings up the Validation window.
Double-clicking on build warnings or errors from validation brings up the Validation window.
7 changes: 0 additions & 7 deletions Documentation~/projectMetadata.json

This file was deleted.

6 changes: 5 additions & 1 deletion Editor/FeatureSupport/FeatureHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,11 @@ public static AllFeatureInfo GetAllFeatureInfo(BuildTargetGroup group)
}

// Update the feature list
openXrSettings.features = all.OrderBy(f => f.name).ToArray();
openXrSettings.features = all
.Where(f => f != null)
.OrderByDescending(f => f.priority)
.ThenBy(f => f.nameUi)
.ToArray();

// Populate the internal feature variables for all features
foreach (var feature in openXrSettings.features)
Expand Down
47 changes: 44 additions & 3 deletions Editor/OpenXRProjectValidationRulesSetup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
using UnityEngine.XR.OpenXR.Features;
using System;
using Unity.XR.CoreUtils.Editor;
using UnityEditor.XR.Management;
using UnityEngine.XR.Management;

[assembly: InternalsVisibleTo("UnityEditor.XR.OpenXR.Tests")]
namespace UnityEditor.XR.OpenXR
Expand Down Expand Up @@ -56,9 +58,7 @@ private static void ShowWindowIfIssuesExist()
OpenXRProjectValidation.GetCurrentValidationIssues(failures, activeBuildTargetGroup);

if (failures.Count > 0)
{
ShowWindow();
}
}

internal static BuildValidationRule ConvertRuleToBuildValidationRule(OpenXRFeature.ValidationRule rule, BuildTargetGroup buildTargetGroup)
Expand Down Expand Up @@ -109,10 +109,21 @@ static void AddOpenXRValidationRules()
{
foreach (var buildTargetGroup in s_BuildTargetGroups)
{
var coreIssues = new List<BuildValidationRule>();

// Use the default validation rule for the platforms that support OpenXR if they don't currently have the OpenXRLoader as an active loader.
if (buildTargetGroup == BuildTargetGroup.Standalone || buildTargetGroup == BuildTargetGroup.Android || buildTargetGroup == BuildTargetGroup.WSA)
{
if (!IsOpenXRLoaderActiveForBuildTarget(buildTargetGroup))
{
var defaultRule = GetDefaultBuildValidationRule(buildTargetGroup);
coreIssues.Add(defaultRule);
}
}

var issues = new List<OpenXRFeature.ValidationRule>();
OpenXRProjectValidation.GetAllValidationIssues(issues, buildTargetGroup);

var coreIssues = new List<BuildValidationRule>();
foreach (var issue in issues)
{
coreIssues.Add(ConvertRuleToBuildValidationRule(issue, buildTargetGroup));
Expand All @@ -122,6 +133,36 @@ static void AddOpenXRValidationRules()
}
}

static BuildValidationRule GetDefaultBuildValidationRule(BuildTargetGroup targetGroup)
{
var defaultRule = new BuildValidationRule()
{
Message = "Select OpenXR as the active loader for this platform.",
CheckPredicate = () => IsOpenXRLoaderActiveForBuildTarget(targetGroup),
Error = false,
FixIt = () => { SettingsService.OpenProjectSettings("Project/XR Plug-in Management/OpenXR"); },
FixItAutomatic = false,
FixItMessage = "Open Project Settings to select OpenXR as the active loader for this platform."
};

return defaultRule;
}

static bool IsOpenXRLoaderActiveForBuildTarget(BuildTargetGroup buildTargetGroup)
{
XRGeneralSettings settings = XRGeneralSettingsPerBuildTarget.XRGeneralSettingsForBuildTarget(buildTargetGroup);
if (settings?.Manager == null)
return false;

foreach (var loader in settings.Manager.activeLoaders)
{
if (loader.GetType() == typeof(OpenXRLoader))
return true;
}

return false;
}

[MenuItem("Window/XR/OpenXR/Project Validation")]
private static void MenuItem()
{
Expand Down
Loading

0 comments on commit 845d256

Please sign in to comment.