Skip to content

Commit 46c28f5

Browse files
author
Unity Technologies
committed
com.unity.polyspatial.visionos@2.0.0-pre.11
## [2.0.0-pre.11] - 2024-08-12 ### Added - PlayToDevice will now limit the editor framerate to 45 by default in order to lower network congestion. The editor sending too many packets over PlayToDevice could cause significant lag and latency for some users. This limit can be changed in the PlayToDevice window. ### Changed - Duplicate VolumeCameraWindowConfigurations are not allowed - in each project, there can only be one of each of Metal and Unbounded configurations. There can be multiple Bounded configurations, but each Bounded configuration must have a different OutputDimension. ### Deprecated ### Removed ### Fixed - Wrap all MonoPInvokeCallback methods in try/catch to avoid potential crashes in player builds. ### Security
1 parent c981de7 commit 46c28f5

32 files changed

+254
-90
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,23 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
99

1010
For general changes to PolySpatial, refer to the [PolySpatial Changelog](https://docs.unity3d.com/Packages/com.unity.polyspatial@latest?subfolder=/changelog/CHANGELOG.html).
1111

12+
## [2.0.0-pre.11] - 2024-08-12
13+
14+
### Added
15+
- PlayToDevice will now limit the editor framerate to 45 by default in order to lower network congestion. The editor sending too many packets over PlayToDevice could cause significant lag and latency for some users. This limit can be changed in the PlayToDevice window.
16+
17+
### Changed
18+
- Duplicate VolumeCameraWindowConfigurations are not allowed - in each project, there can only be one of each of Metal and Unbounded configurations. There can be multiple Bounded configurations, but each Bounded configuration must have a different OutputDimension.
19+
20+
### Deprecated
21+
22+
### Removed
23+
24+
### Fixed
25+
- Wrap all MonoPInvokeCallback methods in try/catch to avoid potential crashes in player builds.
26+
27+
### Security
28+
1229
## [2.0.0-pre.9] - 2024-07-24
1330

1431
### Added

Documentation~/Billboard.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,3 @@ The **VisionOSBillboard** component ensures an object always faces the user, eve
88
| **Property** | **Description** |
99
| --- | --- |
1010
| **Blend Factor** | "Degree" that entity rotates towards camera. |
11-
| **Forward Direction** | Vector in local space that will point towards camera. |
12-
| **Up Direction** | Direction in local space to align with world up. |
13-
| **Rotation Axis** | World space axis to rotate around, if any. |

Documentation~/HoverEffect.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,8 @@ Within shader graphs, the hover state may be accessed using the `PolySpatial Hov
3636
| **Time Since Hover Start** | Float | The time in seconds since the hover effect started. |
3737
| **Is Active** | Boolean | Whether or not the hover effect is currently active. |
3838

39-
![VisionOSHoverEffect](images/ReferenceGuide/VisionOSHoverEffect.png)
39+
![VisionOSHoverEffect](images/ReferenceGuide/VisionOSHoverEffect.png)
40+
41+
<a id="ugui-selectable-hover-transitions"></a>
42+
## UGUI Selectable hover transitions
43+
On visionOS, hover transitions for certain `Selectable` objects (`Button`, `Dropdown`, `TMP_Dropdown`, `InputField`, `TMP_InputField`, `Scrollbar`, `Slider`, and `Toggle`) are automatically handled by adding a hover effect component to the Selectable's `targetGraphic` and using the `PolySpatial Hover State` shader graph node in the PolySpatial UI image shader graph (`Packages/PolySpatial/Resources/Shaders/MaskingShader.shadergraph`) to switch between the normal `Color` and a separate `HoverColor` property. Note that only `Color Tint` transitions are supported for hover through this method and that any custom UI shaders (that is, shaders other than `UI/Default`) must replicate the properties and hover state functionality of `MaskingShader` in order to show transitions on hover.

Documentation~/MetalApps.md

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,63 @@ uid: psl-vos-metal-apps
33
---
44
# Metal-based Apps on visionOS
55

6-
With Unity, users can leverage on familiar workflows to build [fully immersive experiences for VisionOS](https://developer.apple.com/documentation/visionOS/creating-fully-immersive-experiences), including virtual reality games or fully virtual environments. Today, Unity provides a wide [range of features and APIs](https://docs.unity3d.com/Manual/VROverview.html) that can be used to develop fully immersive experiences for visionOS. Such packages include:
6+
With Unity, users can leverage familiar workflows to build Metal-based apps using [**Compositor Services**](https://developer.apple.com/documentation/compositorservices) for visionOS, allowing users to create [fully immersive](https://developer.apple.com/documentation/visionOS/creating-fully-immersive-experiences) or mixed immersion experiences. Today, Unity provides a wide [range of features and APIs](https://docs.unity3d.com/Manual/VROverview.html) that can be used to develop experiences for visionOS. Such packages include:
77

8-
* [visionOS plug-in]()
8+
[//]: # (TODO: LXR-3988 Once visionOS plug-in docs page is created, link the below to that docs page.)
9+
* visionOS plug-in
910
* [XR Interaction Toolkit](https://docs.unity3d.com/Manual/VROverview.html#xr-interaction-toolkit)
1011
* [XR Core Utilities](https://docs.unity3d.com/Manual/VROverview.html#xr-core-utilities)
1112
* [Input System](https://docs.unity3d.com/Manual/VROverview.html#input-system)
1213
* [VR project template](https://docs.unity3d.com/Manual/VROverview.html#vr-template)
1314
* [Hand tracking](https://docs.unity3d.com/Manual/VROverview.html#hand-tracking)
1415

15-
Once you’ve built your VR content in Unity, simply select **Apple visionOS** on the XR Plug-in Management window, select and build for the visionOS platform, recompile native plugins and a Unity XCode Project file will be generated. From here on, [you’ll continue your development process in XCode](https://developer.apple.com/documentation/visionOS/creating-fully-immersive-experiences), where you can explore concepts like transitioning between windowed content and fully immersive content.
16+
To get started, simply select **Apple visionOS** on the **XR Plug-in Management** window in **Project Settings**, then navigate to the **Apple visionOS** project setting below **XR Plugin-in Management**.
17+
18+
Set the App Mode to **Metal Rendering with Compositor Services**. If you are using ARKit features, you may also need to set a **Hands Tracking Usage Description** and/or a **World Sensing Usage Description**.
19+
20+
![MetalAppSetting](images/ReferenceGuide/MetalAppSettings.png)
21+
22+
The Apple visionOS project settings menu has a few properties pertaining to the **Metal Rendering with Compositor Services** app mode.
23+
24+
[//]: # (TODO: LXR-3988 Once visionOS plug-in docs page is created, put the below into that docs page.)
25+
| **Property** | **Description** |
26+
|:----------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
27+
| **Initialize Hand Tracking On Startup** | Initializes hand tracking when application starts up. |
28+
| **Metal Immersion Style** | Defines the immersion style to be used in Metal-based apps. Immersion style determines whether an app will have pass-through. For Metal-based apps, only two immersion styles are valid - **Mixed** and **Full**. The **Progressive** immersion style is not supported with Metal-based apps. |
29+
| &nbsp;&nbsp;&nbsp;&nbsp;*Automatic* | For Metal-based apps, choosing **Automatic** will cause the app to fallback to **Mixed** immersion style. |
30+
| &nbsp;&nbsp;&nbsp;&nbsp;*Full* | With this immersion style, pass-through is disabled, and only the skybox will be shown. |
31+
| &nbsp;&nbsp;&nbsp;&nbsp;*Mixed* | With this immersion style, apps will have pass-through video feed. This immersion style allows an app to switch at runtime between allowing pass-through and rendering the skybox. |
32+
| **RealityKit Immersion Style** | Defines the immersion style to be used in RealityKit-based apps. Immersion style determines whether your application will have pass-through. Although all immersion styles are applicable to RealityKit-based apps, the effects of some immersion styles will differ depending on the **VolumeCamera** **Mode**. |
33+
| &nbsp;&nbsp;&nbsp;&nbsp;*Automatic* | For RealityKit-based apps, choosing **Automatic** will cause the app to fallback to **Mixed** immersion style. |
34+
| &nbsp;&nbsp;&nbsp;&nbsp;*Full* | If all **VolumeCamera**s are set to **Bounded** **Mode**, content will still appear with pass-through, as if the app was in **Mixed** immersion style. If one **VolumeCamera** in the scene is set to **Unbounded** **Mode**, pass-through will be disabled and replaced with a black background, and only content will be visible. The **Digital Crown** will have no effect. |
35+
| &nbsp;&nbsp;&nbsp;&nbsp;*Mixed* | With this immersion style, apps will have pass-through video feed. **VolumeCamera** **Mode** will have no effect on this immersion style. |
36+
| &nbsp;&nbsp;&nbsp;&nbsp;*Progressive* | If all **VolumeCamera**s are set to **Bounded** **Mode**, content will still appear with pass-through, as if the app was in **Mixed** immersion style. If one **VolumeCamera** in the scene is set to **Unbounded** **Mode**, content will appear inside a radial portal with a black background. See [Progressive Immersion](RealityKitApps.md#progressive-immersion) for more details. |
37+
| **Upper Limb Visibility** | This option allows for controlling whether the hands are visible within the app. This option is ignored if the **App Mode** is Windowed, or if the **App Mode** is set to RealityKit but the scene consists of only **Bounded** **VolumeCamera**s. |
38+
| &nbsp;&nbsp;&nbsp;&nbsp;*Automatic* | Hands visibility will be determined by visionOS's default hands setting, which will depend on the context. |
39+
| &nbsp;&nbsp;&nbsp;&nbsp;*Visible* | In **Metal** **App Mode**, the hands will always be visible in the app. Hands always render on top of virtual content. In **RealityKit** **App Mode**, the hands are blended with virtual content based on depth. |
40+
| &nbsp;&nbsp;&nbsp;&nbsp;*Hidden* | In **Metal** **App Mode**, the hands will be hidden, which may be beneficial if you wish to present virtual hands instead. In **RealityKit** **App Mode**, the hands will be displayed behind virtual content. |
41+
| **Foveated Rendering** | This option controls whether foveated rendering is enabled or disabled. This option only applies to Metal-based content, and requires the Universal Render Pipeline. |
42+
| **IL2CPP Large Exe Workaround** | When building your project in Xcode, you may encounter an error such as `ARM64 branch out of range`, especially with larger projects. This option will patch the project to work around this error. |
43+
44+
After modifying the project settings, select and build for the visionOS platform in the **Build Profiles** menu. This will generate a Unity XCode Project. From here on, you'll continue the build process in the XCode project, debugging in XCode as needed.
1645

1746
>Please note that Unity is still building towards feature parity with the Metal API on XCode, so you might observe warnings from Metal’s API validation layer. To work around this, you can turn off the Metal API Validation Layer via XCode’s scheme menu.
1847
48+
### Pass-through Video in Metal Mode
49+
With visionOS 2, apps set to **Metal Rendering with Compositor Services** can now show pass-through instead of just the skybox. The steps for enabling pass-through with Metal-based apps are the same as the steps for enabling pass-through with [Hybrid](PolySpatialHybridApps.md) apps.
50+
51+
1. Set the **Metal Immersion Style** under the **Apple visionOS** project setting to **Mixed** or **Automatic**.
52+
2. Set your Unity **Camera**'s **Background Type** to **Solid Color**.
53+
3. Under **Background Type**, click on **Background**. Set the RGBA values for the background color to 0. You can technically use any color here, but ensure the **Alpha** value is set to 0.
54+
55+
You may switch **Background Type** from **Solid Color** to **Skybox** in order to switch from showing pass-through to showing the skybox, and vice-versa.
56+
57+
> [!NOTE]
58+
> When you set **Background Type** to **Skybox** (both in the Inspector and via scripting API), Unity will change the alpha value of the background color to 1. When you switch back to pass-through, you must _also_ set the background color to something transparent.
59+
60+
> [!NOTE]
61+
> You will need to disable **HDR** on your **Universal Render Pipeline Asset** to get pass-through to work.
62+
1963
## Porting VR experiences to visionOS
2064
For users who are looking to port existing VR titles looking to visionOS as a fully immersive experience there are a few things you can do to make the transition smoother, in addition to the build workflow elaborated in the above section.
2165

Documentation~/PlayToDevice.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ If you notice that your connection is timing out, you can increase the connectio
7070

7171
**NOTE**: If you select multiple connections at once, content will be streamed to all selected hosts simultaneously.
7272

73+
**NOTE**: Limit Frames Per Second should be enabled and set to the expected framerate on device. If the editor runs significantly faster than the device it can overload the network with unnecessary messages making Play To Device feel unresponsive.
74+
7375
**NOTE**: Your project's **App Mode** must be set to `RealityKit with PolySpatial` in order to use Play To Device. You can access this setting in the **Apple visionOS** section under **XR Plug-in Management** in your **Project Settings**.
7476

7577
## Subsequent Usage

0 commit comments

Comments
 (0)