com.unity.xr.arfoundation 6.1.0-pre.4
Source docsNotes: processedReleased December 27, 2024
Unity Compatibility
Minimum Unity: 6000.0
Package Dependencies
- com.unity.editorcoroutines (1.0.0)
- com.unity.inputsystem (1.6.3)
- com.unity.mathematics (1.2.6)
- com.unity.modules.particlesystem (1.0.0)
- com.unity.modules.ui (1.0.0)
- com.unity.modules.unityanalytics (1.0.0)
- com.unity.modules.unitywebrequest (1.0.0)
- com.unity.ugui (2.0.0)
- com.unity.xr.core-utils (2.5.1)
- com.unity.xr.management (4.4.0)
✨ Features
- Added camera torch mode support to XR Simulation.
- Added APIs for batch save, load, and erase of persistent anchors. Refer to [Persistent anchors](xref:arfoundation-anchors-persistent) for more information.
- Added [XROcclusionSubsystem.TryGetSwapchainTextureDescriptors](xref:UnityEngine.XR.ARSubsystems.TryGetSwapchainTextureDescriptors*), which allows AR Foundation to make optimizations for occlusion providers that store textures in fixed-length swapchains.
- Added overrides for `object.ToString` to the following types for an improved debugging experience:
- - [ARExternalTexture](xref:UnityEngine.XR.ARFoundation.ARExternalTexture)
- - [XRFov](xref:UnityEngine.XR.ARSubsystems.XRFov)
- - [XRNearFarPlanes](xref:UnityEngine.XR.ARSubsystems.XRNearFarPlanes)
- Added a constructor to [XRTextureDescriptor](xref:UnityEngine.XR.ARSubsystems.XRTextureDescriptor) that allows you to create an instance with only the property name ID field set.
- Added a new struct [XRShaderKeywords](xref:UnityEngine.XR.ARSubsystems.XRShaderKeywords) to replace the `ShaderKeywords` struct. `ShaderKeywords` was introduced to make shader keywords read-only, but its collection enumerators perform boxing operations. `XRShaderKeywords` does not allocate memory on the heap when enumerated.
- - Added support for the `XRShaderKeywords` struct to the XR Simulation camera and occlusion providers.
- Added a new value to [XRResultStatus](xref:UnityEngine.XR.ARSubsystems.XRResultStatus): `ProviderNotStarted`.
- Added a new enum [AROcclusionShaderMode](xref:UnityEngine.XR.ARFoundation.AROcclusionShaderMode) and property [ARShaderOcclusion.occlusionShaderMode](xref:UnityEngine.XR.ARFoundation.ARShaderOcclusion.occlusionShaderMode) to enable or disable hard occlusion.
- Added the following properties to the AR Shader Occlusion component:
- - `hardOcclusionShaderKeyword`
- - `environmentDepthProjectionMatricesPropertyId`
- - `environmentDepthNearFarPlanesPropertyId`
- Added two new values to the [XRTextureType](xref:UnityEngine.XR.ARSubsystems.XRTextureType) enum: `ColorRenderTextureRef` and `DepthRenderTextureRef`, and updated the `IsRenderTexture` extension method to include these types.
📈 Improvements
- Changed the [AR Occlusion Manager component](xref:arfoundation-occlusion-manager) to add `[RequireComponent(typeof(Camera))]`. Previously, it was logically required that this component was on the same GameObject as your XR Origin's Camera, but this wasn't as clearly enforced.
- Changed the timing of `AROcclusionManager.frameReceived` so that this event is now invoked during `Application.onBeforeRender` instead of `MonoBehaviour.Update`. This change is required for compatibility with head-mounted-display (HMD) providers, and may result in improved precision of occlusion frames.
- Changed the [AR Shader Occlusion component](xref:arfoundation-shader-occlusion) to construct view-projection matrices using poses reported by `AROcclusionFrameEventArgs` instead of getting the XR camera's `WorldToCameraMatrix`.
- Changed the default implementation of the pre-release API `XROcclusionSubsystem.TryGetFrame` to return `true`. As an additive API in AR Foundation 6.1, this method must succeed for providers that don't override it.
- Renamed the pre-release type `ARGpuTexture` to `ARExternalTexture`, and added support for the `IEquatable` interface.
- Changed the XR Simulation Environments version imported by the XR Environment Overlay from 2.0.1 to 2.1.1
- Changed the dependency version of XR Core Utilities from 2.4.0 to 2.5.1.
- ### Deprecated
- Deprecated and replaced the following APIs:
- - `ShaderKeywords` to `XRShaderKeywords`
- - `XRCameraSubsystem.GetShaderKeywords` to `XRCameraSubsystem.GetShaderKeywords2`
- - `XRCameraSubsystem.Provider.GetShaderKeywords` to `XRCameraSubsystem.Provider.GetShaderKeywords2`
- - `XROcclusionSubsystem.GetShaderKeywords` to `XROcclusionSubsystem.GetShaderKeywords2`
- - `XROcclusionSubsystem.Provider.GetShaderKeywords` to `XROcclusinSubsystem.Provider.GetShaderKeywords2`
- - \`ARCameraFrameEventArgs.disabledShaderK
