Skip to content

Commit 4255741

Browse files
author
Unity Technologies
committed
com.unity.polyspatial.visionos@1.3.1
## [1.3.1] - 2024-07-09 ## [1.3.0] - 2024-06-26 ### Added - Added support for adding new reference images at runtime, refer to [ARFoundation](https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@6.0/manual/features/image-tracking.html#add-new-reference-images-at-runtime) documentation. - Added tracked image support to the "PolySpatial XR" Plug-in Provider, under XR Plug-in Managment.
1 parent faa74f5 commit 4255741

13 files changed

+68
-23
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ 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+
## [1.3.1] - 2024-07-09
13+
14+
## [1.3.0] - 2024-06-26
15+
16+
### Added
17+
- Added support for adding new reference images at runtime, refer to [ARFoundation](https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@6.0/manual/features/image-tracking.html#add-new-reference-images-at-runtime) documentation.
18+
- Added tracked image support to the "PolySpatial XR" Plug-in Provider, under XR Plug-in Managment.
19+
1220
## [1.2.3] - 2024-04-23
1321

1422
## [1.2.2] - 2024-04-22
@@ -18,7 +26,6 @@ For general changes to PolySpatial, refer to the [PolySpatial Changelog](https:/
1826
## [1.2.0] - 2024-04-19
1927

2028
### Added
21-
2229
- Added a loading screen during initial Play To Device loading
2330
- Added support for procedural skinned meshes. Updating a skinned mesh will now notify all skinned mesh renderers using that mesh to update.
2431

Documentation~/CustomFunctionNode.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ genType splitlr(genType valuel, genType valuer, float center, float2 texcoord);
4545
(where `genType` is one of `float`, `float2`, `float3`, or `float4`)
4646

4747
### Unity Macros
48-
For sampling textures, the parser supports Unity macros: `SAMPLE_TEXTURE2D`, `SAMPLE_TEXTURE2D_LOD`, `SAMPLE_TEXTURE3D`, `SAMPLE_TEXTURE3D_LOD`, `SAMPLE_TEXTURECUBE_LOD`
48+
For sampling textures, the parser supports Unity macros: `GATHER_TEXTURE2D`, `SAMPLE_TEXTURE2D`, `SAMPLE_TEXTURE2D_LOD`, `SAMPLE_TEXTURE3D`, `SAMPLE_TEXTURE3D_LOD`, `SAMPLE_TEXTURECUBE_LOD`
4949

5050
## Supported Globals
5151
The parser supports several of Unity's built-in global variables: `_Time`, `_SinTime`, `_CosTime`, `unity_DeltaTime`, `unity_ObjectToWorld`, `unity_WorldToObject`, `UNITY_MATRIX_V`, `UNITY_MATRIX_I_V`, `UNITY_MATRIX_P`, `UNITY_MATRIX_I_P`, `UNITY_MATRIX_VP`, `UNITY_MATRIX_I_VP`

Documentation~/PlayToDevice.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Additionally, the PlayToDevice UI will appear in the last used **VolumeCameraWin
7272

7373
## AR visualization in editor
7474

75-
You can visualize AR planes and hand data from your device in your editor when using the Play To Device feature. To enable this functionality go to `Project Settings` > `XR Plug-in Management`.
75+
You can visualize AR planes, tracked images, meshes, and hand data from your device in your editor when using the Play To Device feature. To enable this functionality go to `Project Settings` > `XR Plug-in Management`.
7676
Under the Standalone target look for `Plug-in Providers` turn on `PolySpatial XR`. Make sure to disable `XR Simulation` if it is on.
7777

7878
![XRPluginManagementP2D.png](images/PlayToDevice/XRPluginManagementP2D.png)

Documentation~/ShaderGraph.md

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ To obtain positions, normals, tangents, or bitangents in the world space of the
2222
### Notes on Transform and Transformation Matrix nodes in VisionOS
2323
The matrices returned by the `Transformation Matrix` node and used by the `Transform` node are obtained directly from visionOS and currently assume a world space that does not match either the simulation scene or the output of the `Position`, `Normal Vector`, `Tangent Vector`, or `Bitangent Vector` nodes. The "world space" output of those nodes is relative to the transform of the output volume--that is, it does not change when a bounded app volume is dragged around. The `Transform` and `Transformation Matrix` nodes, on the other hand, assume a world space that is shared between all app volumes. To get geometry in this world space, use the geometry (e.g., `Position`) node with `Space`: `Object` and transform it with the `Transform` node set to `From`: `Object` and `To`: `World`.
2424

25-
## Input properties
26-
Shader graph properties must be set to `Exposed` in order to be set on a per-instance basis. Globals must *not* be `Exposed`, and global values must be set in C# using the methods of [PolySpatialShaderGlobals](https://docs.unity3d.com/Packages/com.unity.polyspatial@latest?subfolder=/api/Unity.PolySpatial.PolySpatialShaderGlobals.html#methods).
25+
## Global properties
26+
Global values must be set in C# using the methods of [PolySpatialShaderGlobals](https://docs.unity3d.com/Packages/com.unity.polyspatial@latest?subfolder=/api/Unity.PolySpatial.PolySpatialShaderGlobals.html#methods).
2727

2828
### Time-based animation
2929
Note that visionOS materials do not support global properties natively, and thus PolySpatial must apply global properties separately to all material instances, which may affect performance. For animation, consider using the `PolySpatial Time` node rather than the standard Unity shader graph `Time`. While `PolySpatial Time` will not be exactly synchronized with [Time.time](https://docs.unity3d.com/ScriptReference/Time-time.html) (notably, it will not reflect changes to [Time.timeScale](https://docs.unity3d.com/ScriptReference/Time-timeScale.html)), it is supported natively in visionOS and does not require per-frame property updates.
@@ -113,7 +113,9 @@ If a node doesn't appear here it means that it's not currently supported. *Note
113113
| | Gradient | <span style="color: green; font-weight: bold;">&#x2713; Supported</span> |
114114
| | Sample Gradient | <span style="color: green; font-weight: bold;">&#x2713; Supported</span> |
115115
| Lighting | Ambient | <span style="color: green; font-weight: bold;">&#x2713; Supported</span> |
116+
| | Baked GI | Subject to limitations of [PolySpatial Lighting Node](PolySpatialLighting.md) |
116117
| | Main Light Direction | <span style="color: green; font-weight: bold;">&#x2713; Supported</span> |
118+
| | Reflection Probe | <span style="color: green; font-weight: bold;">&#x2713; Supported</span> |
117119
| Matrix | Matrix 2x2 | <span style="color: green; font-weight: bold;">&#x2713; Supported</span> |
118120
| | Matrix 3x3 | <span style="color: green; font-weight: bold;">&#x2713; Supported</span> |
119121
| | Matrix 4x4 | <span style="color: green; font-weight: bold;">&#x2713; Supported</span> |
@@ -127,6 +129,7 @@ If a node doesn't appear here it means that it's not currently supported. *Note
127129
| | Scene Depth | Platform doesn't allow have access to the depth buffer, this is just the camera distance in either clip or view space. |
128130
| | Screen | <span style="color: green; font-weight: bold;">&#x2713; Supported</span> |
129131
| Texture | Cubemap Asset | <span style="color: green; font-weight: bold;">&#x2713; Supported</span> |
132+
| | Gather Texture 2D | <span style="color: green; font-weight: bold;">&#x2713; Supported</span> |
130133
| | Sample Cubemap | <span style="color: green; font-weight: bold;">&#x2713; Supported</span> |
131134
| | Sample Reflected Cubemap | <span style="color: green; font-weight: bold;">&#x2713; Supported</span> |
132135
| | Sample Texture 2D | <span style="color: green; font-weight: bold;">&#x2713; Supported</span> |
@@ -239,14 +242,15 @@ If a node doesn't appear here it means that it's not currently supported. *Note
239242

240243
### UV
241244

242-
| Section | Node | Notes |
243-
|---------|-------------------|--------------------------------------------------------------------------|
244-
| UV | Flipbook | <span style="color: green; font-weight: bold;">&#x2713; Supported</span> |
245-
| | Parallax Mapping | <span style="color: green; font-weight: bold;">&#x2713; Supported</span> |
246-
| | Polar Coordinates | <span style="color: green; font-weight: bold;">&#x2713; Supported</span> |
247-
| | Radial Shear | <span style="color: green; font-weight: bold;">&#x2713; Supported</span> |
248-
| | Rotate | <span style="color: green; font-weight: bold;">&#x2713; Supported</span> |
249-
| | Spherize | <span style="color: green; font-weight: bold;">&#x2713; Supported</span> |
250-
| | Tiling and Offset | <span style="color: green; font-weight: bold;">&#x2713; Supported</span> |
251-
| | Triplanar | <span style="color: green; font-weight: bold;">&#x2713; Supported</span> |
252-
| | Twirl | <span style="color: green; font-weight: bold;">&#x2713; Supported</span> |
245+
| Section | Node | Notes |
246+
|---------|-----------------------------|--------------------------------------------------------------------------|
247+
| UV | Flipbook | <span style="color: green; font-weight: bold;">&#x2713; Supported</span> |
248+
| | Parallax Mapping | <span style="color: green; font-weight: bold;">&#x2713; Supported</span> |
249+
| | Parallax Occlusion Mapping | `Steps` input must be constant (unconnected). |
250+
| | Polar Coordinates | <span style="color: green; font-weight: bold;">&#x2713; Supported</span> |
251+
| | Radial Shear | <span style="color: green; font-weight: bold;">&#x2713; Supported</span> |
252+
| | Rotate | <span style="color: green; font-weight: bold;">&#x2713; Supported</span> |
253+
| | Spherize | <span style="color: green; font-weight: bold;">&#x2713; Supported</span> |
254+
| | Tiling and Offset | <span style="color: green; font-weight: bold;">&#x2713; Supported</span> |
255+
| | Triplanar | <span style="color: green; font-weight: bold;">&#x2713; Supported</span> |
256+
| | Twirl | <span style="color: green; font-weight: bold;">&#x2713; Supported</span> |
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
uid: psl-static-batch-element
3+
---
4+
# Static Batch Elements
5+
6+
The **PolySpatialStaticBatchElement** component provides a hint to the platform that a `GameObject` containing a `MeshRenderer` will never move relative to a root `GameObject` or to the scene root (depending on the value of the `Root` property). This allows the platform to batch meshes that share the same root together, reducing the number of draw calls and (often) improving performance. For more information on static batching, refer to the documentation for [StaticBatchingUtility](https://docs.unity3d.com/ScriptReference/StaticBatchingUtility.html). Note that on visionOS, PolySpatial cannot separately control the visibility of batch elements. Elements with the same material and lighting parameters are simply combined into a single mesh and rendered together.
7+
8+
The `PolySpatial Static Batch Element` component exposes the following properties:
9+
10+
| **Property** | **Description** |
11+
| --- | --- |
12+
| **Root** | The root `GameObject` relative to which the element will stay fixed, or `None` if it will stay fixed relative to the scene root. |
13+
| **Apply to Descendants** | If true, all descendants of the GameObject to which the component is attached will also be considered static with respect to the root. |
14+
15+
## Static Editor Flags
16+
If [Static Batching](https://docs.unity3d.com/Manual/static-batching.html) is enabled in the Player settings, GameObjects with `Batching Static` enabled will automatically receive instances of `PolySpatialStaticBatchElement` that batch them relative to the scene root.

Documentation~/TableOfContents.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
* [Grounding Shadows](GroundingShadow.md)
3333
* [Image Based Lights](ImageBasedLight.md)
3434
* [Sorting Groups](SortingGroup.md)
35+
* [Static Batch Elements](StaticBatchElement.md)
3536
* [Platform Text](PlatformText.md)
3637
* [Tooling](Tooling.md)
3738
* [visionOS Samples](Samples.md)

Documentation~/visionOSPlatformOverview.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,14 @@ Unity supports several different application types on visionOS, each with their
2323
* If you're interested in creating fully immersive virtual reality (VR) apps for visionOS, refer to [Fully Immersive VR apps on visionOS](VRApps.md) for more information.
2424
* If you're interested in creating immersive mixed reality (MR) apps for visionOS, refer to [PolySpatial MR Apps on visionOS](PolySpatialMRApps.md) for more information. These apps are built with Unity's newly developed PolySpatial technology, where apps are simulated with Unity, but rendered with RealityKit, the system renderer of visionOS.
2525
* If you're interested in creating content that will run in a window on visionOS, refer to [Windowed Apps on visionOS](WindowedApps.md) for more information.
26+
27+
### AR Authorizations
28+
In order to use ARKit features like hand tracking and world sensing, your app must prompt the user for authorization. These prompts will display a customizable usage description, which must be provided in the visionOS settings under `Project Settings > XR Plug-in Management > Apple visionOS`. Unity apps can make use of ARKit features on visionOS by using [AR Foundation](https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@latest) components like `ARPlaneManager`. For visionOS specifically, there are two types of AR Authorization:
29+
- Hand Tracking
30+
- World Sensing
31+
As the name implies, hand tracking authorization is needed to make use of ARKit's hand tracking capabilities, and is exposed in Unity via the XR Hands package (`com.unity.xr.hands`). The World Sensing authorization applies to the remaining ARKit features like planes, meshes, image tracking, and world anchors. Note that head pose is exposed via ARKit, and is the one exception as it does not require any authorization.
32+
33+
These authorizations are requested automatically by the visionOS XR Plugin as features are needed. For example, when an `ARPlaneManager` is enabled, and the user has not already been prompted to authorize the app to use World Sensing features, a dialog will appear showing the world sensing usage description, with buttons labeled `Allow` or `Deny`. Once the user responds to this dialog, the authorization is stored along with other app metadata, and the authorization will remain valid until the app is uninstalled, or the user manually navigates to the app in Settings to change a particular authorization.
34+
35+
36+
We provide scripting APIs for querying the state of a particular authorization. You can either call [VisionOS.QueryAuthorizationStatus](xref:UnityEngine.XR.VisionOS.VisionOS.QueryAuthorizationStatus)) to get the status of a particular authorization type, or you can subscribe to the [VisionOS.AuthorizationChanged](xref:UnityEngine.XR.VisionOS.VisionOS.AuthorizationChanged)) event in order to be informed of authorization changes. Usage of these APIs is demonstrated by the `Debug` UI panel in the main package sample scene for `com.unity.xr.visionos`.

Lib~/PolySpatialRealityKit.swiftmodule/arm64-apple-xros-simulator.swiftinterface

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// swift-compiler-version: Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)
33
// swift-module-flags: -target arm64-apple-xros1.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name PolySpatialRealityKit
44
// swift-module-flags-ignorable: -enable-bare-slash-regex
5+
import ARKit
56
import AVFoundation
67
import Combine
78
import CoreGraphics
@@ -31,6 +32,7 @@ public class PolySpatialWindow : Swift.Identifiable, Swift.Hashable, Swift.Equat
3132
public var outputDimensions: simd.simd_float3
3233
public var actualDimensions: simd.simd_float3
3334
public var rootEntity: RealityFoundation.Entity
35+
public var inputTransform: simd.simd_float4x4
3436
public var id: Foundation.UUID {
3537
get
3638
}

Lib~/PolySpatialRealityKit.swiftmodule/arm64-apple-xros.swiftinterface

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// swift-compiler-version: Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)
33
// swift-module-flags: -target arm64-apple-xros1.0 -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name PolySpatialRealityKit
44
// swift-module-flags-ignorable: -enable-bare-slash-regex
5+
import ARKit
56
import AVFoundation
67
import Combine
78
import CoreGraphics
@@ -31,6 +32,7 @@ public class PolySpatialWindow : Swift.Identifiable, Swift.Hashable, Swift.Equat
3132
public var outputDimensions: simd.simd_float3
3233
public var actualDimensions: simd.simd_float3
3334
public var rootEntity: RealityFoundation.Entity
35+
public var inputTransform: simd.simd_float4x4
3436
public var id: Foundation.UUID {
3537
get
3638
}

Lib~/PolySpatialRealityKit.swiftmodule/x86_64-apple-xros-simulator.swiftinterface

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// swift-compiler-version: Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)
33
// swift-module-flags: -target x86_64-apple-xros1.0-simulator -enable-objc-interop -enable-library-evolution -swift-version 5 -enforce-exclusivity=checked -O -module-name PolySpatialRealityKit
44
// swift-module-flags-ignorable: -enable-bare-slash-regex
5+
import ARKit
56
import AVFoundation
67
import Combine
78
import CoreGraphics
@@ -31,6 +32,7 @@ public class PolySpatialWindow : Swift.Identifiable, Swift.Hashable, Swift.Equat
3132
public var outputDimensions: simd.simd_float3
3233
public var actualDimensions: simd.simd_float3
3334
public var rootEntity: RealityFoundation.Entity
35+
public var inputTransform: simd.simd_float4x4
3436
public var id: Foundation.UUID {
3537
get
3638
}

0 commit comments

Comments
 (0)