Hybrid visionOS sample project


Hey there!,
I trying to replicate this on my Apple vision pro device.

I have seen that this is the VR templete, when I went to try it I had several problems with the tunneling shaders and some skeletal meshes and i dont know if with this 2.0 polyspatial pre release , is there one more sample with this functionality.

Thanks!

Hi,

I’ll need some clarification on what you’re trying to accomplish - are you just trying to get pass-through with a Metal-based app?

If so, you can import the Apple visionOS XR Plugin (com.unity.xr.visionos, version 2.0.0-pre.9) through Unity’s Package Manager, and then import the Metal Sample - Built-in scenes. That’ll give you access to a scene called InputSystem UI that you can use to test Metal-based pass-through.

You’ll also have to import XR Interaction Toolkit (com.unity.xr.interaction.toolkit) to get input working in that scene.

Afterwards, you should be able to build and deploy that scene to device and test Metal-based pass-through.

If you’re trying to make a Hybrid app, you’ll have to import the PolySpatial packages, version 2.0.0-pre.9, and then follow the instructions here. You can probably use the template projects as a base for Hybrid mode testing, but you’ll have to make a few modifications, such as changing the Volume Camera’s app mode as described in the Hybrid apps docs.

Hope that helps!

Hi,
Yes it is just what i need, I have gone step by step doing what you told me but i have a exception when the aplicaction its runing on my device, here its the exception:

RequestCreateTexture
SetupRenderTextureFromXRRequest (id: 1 col: 0x0 d: 0x0 sr: 0x0)
RenderTexture::Create (id: 1)
AR authorization result - Type: Hand_Tracking Status: ar_authorization_status_allowed
UnityEngine.DebugLogHandler:Internal_Log_Injected(LogType, LogOption, ManagedSpanWrapper&, IntPtr)
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Logger:Log(LogType, Object)
Unity.VisualScripting.Cloning:CloneInto(CloningContext, Object&, Object)
UnityEngine.Debug:Log(Object)
UnityEngine.XR.VisionOS.VisionOSSessionProvider:ProcessAuthorizationResult(IntPtr)
UnityEngine.XR.VisionOS.VisionOSSessionProvider:EnumerateAuthorizationStepCallback(IntPtr)
UnityEngine.XR.VisionOS.VisionOSSessionProvider:RequestAuthorizationResultsEnumerationCompletedCallback()
UnityEngine.XR.VisionOS.Authorization:UnityVisionOS_impl_ar_authorization_results_enumerate_results(IntPtr, Authorization_Results_Enumeration_Step_Callback, Authorization_Results_Enumeration_Completed_Callback)
UnityEngine.XR.VisionOS.VisionOSSessionProvider:RequestAuthorizationResultsHandler(IntPtr, IntPtr)
UnityEngine.XR.VisionOS.VisionOSSessionProvider:QueryAuthorizationResultsEnumerationCompletedCallback()

libc++abi: terminating due to uncaught exception of type Il2CppExceptionWrapper

this its my settings on the project settings:

I don’t know if I misunderstanding or if I forget something

Thanks!

Update some info about that, I still trying to make an metal example that works on apple device, I change the other configurations see on this post, but I having the same error:

MemoryManager: Using 'Default' Allocator.
[UnityMemory] Configuration Parameters - Can be set up in boot.config
    "memorysetup-allocator-temp-initial-block-size-main=262144"
    "memorysetup-allocator-temp-initial-block-size-worker=262144"
    "memorysetup-bucket-allocator-granularity=16"
    "memorysetup-bucket-allocator-bucket-count=8"
    "memorysetup-bucket-allocator-block-size=4194304"
    "memorysetup-bucket-allocator-block-count=1"
    "memorysetup-main-allocator-block-size=16777216"
    "memorysetup-thread-allocator-block-size=16777216"
    "memorysetup-gfx-main-allocator-block-size=16777216"
    "memorysetup-gfx-thread-allocator-block-size=16777216"
    "memorysetup-cache-allocator-block-size=4194304"
    "memorysetup-typetree-allocator-block-size=2097152"
    "memorysetup-profiler-bucket-allocator-granularity=16"
    "memorysetup-profiler-bucket-allocator-bucket-count=8"
    "memorysetup-profiler-bucket-allocator-block-size=4194304"
    "memorysetup-profiler-bucket-allocator-block-count=1"
    "memorysetup-profiler-allocator-block-size=16777216"
    "memorysetup-profiler-editor-allocator-block-size=1048576"
    "memorysetup-temp-allocator-size-main=4194304"
    "memorysetup-job-temp-allocator-block-size=2097152"
    "memorysetup-job-temp-allocator-block-size-background=1048576"
    "memorysetup-job-temp-allocator-reduction-small-platforms=262144"
    "memorysetup-temp-allocator-size-audio-worker=65536"
    "memorysetup-temp-allocator-size-preload-manager=262144"
    "memorysetup-temp-allocator-size-background-worker=32768"
    "memorysetup-temp-allocator-size-job-worker=262144"
    "memorysetup-temp-allocator-size-gfx=262144"
    "memorysetup-temp-allocator-size-cloud-worker=32768"
    "memorysetup-temp-allocator-size-nav-mesh-worker=65536"
-> applicationDidFinishLaunching()
Found 1 interfaces on host : 0) 192.168.1.47
Player connection [10609776256]  Target information:

Player connection [10609776256]  * "[IP] 192.168.1.47 [Port] 55000 [Flags] 2 [Guid] 276238744 [EditorId] 884296622 [Version] 1048832 [Id] VisionOSPlayer(50,localhost):56000 [Debug] 0 [PackageName] VisionOSPlayer [ProjectName] PolySpatial Project Template" 

Player connection [10609776256] Started UDP target info broadcast (1) on [225.0.0.222:54997].

-> applicationWillEnterForeground()
-> applicationDidBecomeActive()
[UserSettings] Defaults for AppPhysicsUpdateRate accessed 22.459753 after process launch
[UserSettings] Defaults for StateRecorderSystemEnabled accessed 22.464741 after process launch
[UserSettings] Defaults for BandwidthReporterSystemEnabled accessed 22.464760 after process launch
[UserSettings] Defaults for NetworkSyncTickDelay accessed 22.465636 after process launch
Scene willEnterForeground: <UIWindowScene: 0x107831cb0; role: UISceneSessionRoleImmersiveSpaceApplication; persistentIdentifier: es.many-worlds.dpworldavp:SFBSystemService-6C22D154-E110-4500-9E04-355EDD45DB56; activationState: UISceneActivationStateUnattached>, window uuid: nil
Scene became active: <UIWindowScene: 0x107831cb0; role: UISceneSessionRoleImmersiveSpaceApplication; persistentIdentifier: es.many-worlds.dpworldavp:SFBSystemService-6C22D154-E110-4500-9E04-355EDD45DB56; activationState: UISceneActivationStateForegroundActive>
nw_socket_initialize_socket [C1:2] setsockopt SO_NECP_CLIENTUUID failed [22: Invalid argument]
nw_socket_initialize_socket setsockopt SO_NECP_CLIENTUUID failed [22: Invalid argument]
nw_socket_copy_info [C1:2] getsockopt TCP_INFO failed [102: Operation not supported on socket]
nw_socket_copy_info getsockopt TCP_INFO failed [102: Operation not supported on socket]
cannot add handler to 0 from 1 - dropping
[Subsystems] Discovering subsystems at path /private/var/containers/Bundle/Application/A62AA931-315E-46B9-8E81-95D8EAC36C74/PolySpatialProjectTemplate.app/Data/UnitySubsystems
[Subsystems] No descriptors matched for  examples in UnitySubsystems/UnityVisionOS/UnitySubsystemsManifest.json.
[Subsystems] 1 'inputs' descriptors matched in UnitySubsystems/UnityVisionOS/UnitySubsystemsManifest.json
[Subsystems] 1 'displays' descriptors matched in UnitySubsystems/UnityVisionOS/UnitySubsystemsManifest.json
[Subsystems] 1 'meshings' descriptors matched in UnitySubsystems/UnityVisionOS/UnitySubsystemsManifest.json
GfxDevice: creating device client; kGfxThreadingModeThreaded
Initializing Metal device caps: Apple M2 GPU
Initialize engine version: 6000.0.11f1 (fa01dd6b76d5)
[PhysX] Initialized MultithreadedTaskDispatcher with 8 workers.
The referenced script (Unknown) on this Behaviour is missing!
The referenced script on this Behaviour (Game Object '<null>') is missing!
XRGeneral Settings awakening...
UnityEngine.DebugLogHandler:Internal_Log_Injected(LogType, LogOption, ManagedSpanWrapper&, IntPtr)
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Debug:LogFormat(LogType, LogOption, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
UnityEngine.Debug:Log(Object)
UnityEngine.XR.Management.XRGeneralSettings:Awake()

[Subsystems] Loading plugin UnityVisionOS for subsystem VisionOS-Display...
[Subsystems] VisionOS XR Plugin successfully registered Provider for VisionOS-Display
[Subsystems] VisionOS XR Plugin successfully registered Provider for VisionOS-Input
[Subsystems] VisionOS XR Plugin successfully registered Provider for VisionOS-Display
[Subsystems] VisionOS XR Plugin successfully registered Provider for VisionOS-Input
[Subsystems] VisionOS XR Plugin successfully registered Provider for VisionOS-Display
[Subsystems] VisionOS XR Plugin successfully registered Provider for VisionOS-Meshing
[XR] VisionOSDisplayProvider::Initialize
[Subsystems] Loading plugin UnityVisionOS for subsystem VisionOS-Input...
[Subsystems] Loading plugin UnityVisionOS for subsystem VisionOS-Meshing...
New input system (experimental) initialized
NSBundle file:///System/Library/Frameworks/GameController.framework/ principal class is nil because all fallbacks have failed
[XR] Display Start
UnloadTime: 0.172291 ms
Creating default Volume Camera, because no active and enabled Volume Camera is present in the scene. You can disable fallback Volume Camera creation in Project Settings > PolySpatial.
UnityEngine.DebugLogHandler:Internal_Log_Injected(LogType, LogOption, ManagedSpanWrapper&, IntPtr)
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Debug:LogFormat(LogType, LogOption, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
UnityEngine.Debug:LogWarning(Object)
Unity.PolySpatial.Internals.PolySpatialUnitySimulation:SetupDefaultVolumeCamera()
Unity.PolySpatial.Internals.PolySpatialUnitySimulation:OnSceneLoaded(Scene, LoadSceneMode)
UnityEngine.Events.UnityAction`2:Invoke(T0, T1)
UnityEngine.SceneManagement.SceneManager:Internal_SceneLoaded(Scene, LoadSceneMode)
UnityEngine.SceneManagement.SceneManager:Internal_SceneLoaded(Scene, LoadSceneMode)

Using the XROrigin as the parent for the default VolumeCamera.
UnityEngine.DebugLogHandler:Internal_Log_Injected(LogType, LogOption, ManagedSpanWrapper&, IntPtr)
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Debug:LogFormat(LogType, LogOption, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
UnityEngine.Debug:LogWarning(Object)
Unity.PolySpatial.Internals.PolySpatialUnitySimulation:SetupDefaultVolumeCamera()
Unity.PolySpatial.Internals.PolySpatialUnitySimulation:OnSceneLoaded(Scene, LoadSceneMode)
UnityEngine.Events.UnityAction`2:Invoke(T0, T1)
UnityEngine.SceneManagement.SceneManager:Internal_SceneLoaded(Scene, LoadSceneMode)
UnityEngine.SceneManagement.SceneManager:Internal_SceneLoaded(Scene, LoadSceneMode)

DontDestroyOnLoad only works for root GameObjects or components on root GameObjects.
UnityEngine.Object:DontDestroyOnLoad_Injected(IntPtr)
UnityEngine.Object:DontDestroyOnLoad(Object)
Unity.PolySpatial.Internals.PolySpatialUnitySimulation:SetupDefaultVolumeCamera()
Unity.PolySpatial.Internals.PolySpatialUnitySimulation:OnSceneLoaded(Scene, LoadSceneMode)
UnityEngine.Events.UnityAction`2:Invoke(T0, T1)
UnityEngine.SceneManagement.SceneManager:Internal_SceneLoaded(Scene, LoadSceneMode)
UnityEngine.SceneManagement.SceneManager:Internal_SceneLoaded(Scene, LoadSceneMode)

[./Runtime/SceneManager/SceneManager.cpp line 1802376008]

RenderGraph is now enabled.
UnityEngine.DebugLogHandler:Internal_Log_Injected(LogType, LogOption, ManagedSpanWrapper&, IntPtr)
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Debug:LogFormat(LogType, LogOption, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
UnityEngine.Debug:Log(Object)
UnityEngine.Rendering.Universal.UniversalRenderPipeline:.ctor(UniversalRenderPipelineAsset)
UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset:CreatePipeline()
UnityEngine.Rendering.Universal.UniversalRenderPipelineAsset:GetRenderer(Int32)
UnityEngine.Rendering.RenderPipelineAsset:InternalCreatePipeline()
UnityEngine.Rendering.RenderPipelineManager:TryPrepareRenderPipeline(RenderPipelineAsset)
UnityEngine.Rendering.RenderPipelineManager:DoRenderLoop_Internal(RenderPipelineAsset, IntPtr, Object)

fopen failed for data file: errno = 2 (No such file or directory)
Errors found! Invalidating cache...
[AssetManager] Exception calling GetPixels32() on Texture Font Texture. The texture is likely not marked as readable, perhaps because it was dynamically created.
System.ArgumentException: Texture2D.GetPixels32: texture data is either not readable, corrupted or does not exist. (Texture 'Font Texture')
  at UnityEngine.Texture2D.GetPixels32_Injected (System.IntPtr _unity_self, System.Int32 miplevel) [0x00000] in <00000000000000000000000000000000>:0 
  at UnityEngine.Texture2D.GetPixels32 (System.Int32 miplevel) [0x00000] in <00000000000000000000000000000000>:0 
  at UnityEngine.Texture2D.GetPixels32 () [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.PolySpatial.Internals.ConversionHelpers.ToPolySpatialFallbackTextureData (UnityEngine.Texture2D tex2d, System.Action`2[T1,T2] postConversionCallback, UnityEngine.Experimental.Rendering.GraphicsFormat fallbackGraphicsFormat, Unity.PolySpatial.Internals.PolySpatialTextureFallbackMode fallbackMode) [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.PolySpatial.Internals.ConversionHelpers.ToPolySpatialFallbackTextureData (UnityEngine.Texture2D tex2d, System.Action`2[T1,T2] postConversionCallback) [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.PolySpatial.Internals.LocalAssetManager.SendTextureAssetChanged (Unity.PolySpatial.Internals.PolySpatialAssetID assetID, UnityEngine.Object unityTexture, System.Boolean allowNativeTextures) [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.PolySpatial.Internals.LocalAssetManager.ProcessChangedAsset (Unity.PolySpatial.Internals.AssetRepresentation representation) [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.PolySpatial.Internals.LocalAssetManager.FetchAssetChangesCallback (Unity.PolySpatial.Internals.ObjectDispatcherProxy+TypeDispatchData data) [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.PolySpatial.Internals.MathBridge.ApproximatelyEqual (UnityEngine.Matrix4x4 lhs, UnityEngine.Matrix4x4 rhs, System.Single epsilon) [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.PolySpatial.Internals.ObjectDispatcherProxy+TypeDispatchData..ctor (UnityEngine.TypeDispatchData real) [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.PolySpatial.Internals.ObjectDispatcherProxy+<>c__DisplayClass13_0.<.ctor>b__0 (UnityEngine.TypeDispatchData real) [0x00000] in <00000000000000000000000000000000>:0 
  at UnityEngine.SpaceAttribute..ctor (System.Single height) [0x00000] in <00000000000000000000000000000000>:0 
  at UnityEngine.ObjectDispatcher+<>c.<.cctor>b__64_0 (UnityEngine.Object[] changed, System.IntPtr changedID, System.IntPtr destroyedID, System.Int32 changedCount, System.Int32 destroyedCount, System.Action`1[T] callback) [0x00000] in <00000000000000000000000000000000>:0 
  at UnityEngine.ObjectDispatcher+<>c.<.cctor>b__64_0 (UnityEngine.Object[] changed, System.IntPtr changedID, System.IntPtr destroyedID, System.Int32 changedCount, System.Int32 destroyedCount, System.Action`1[T] callback) [0x00000] in <00000000000000000000000000000000>:0 
  at System.Action`6[T1,T2,T3,T4,T5,T6].Invoke (T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) [0x00000] in <00000000000000000000000000000000>:0 
  at UnityEngine.ObjectDispatcher.DispatchTypeChangesAndClear (System.IntPtr ptr, System.Type type, System.Action`6[T1,T2,T3,T4,T5,T6] callback, System.Boolean sortByInstanceID, System.Boolean noScriptingArray, System.Action`1[T] param) [0x00000] in <00000000000000000000000000000000>:0 
  at UnityEngine.ObjectDispatcher.DispatchTypeChangesAndClear (System.Type type, System.Action`1[T] callback, System.Boolean sortByInstanceID, System.Boolean noScriptingArray) [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.PolySpatial.Internals.ObjectDispatcherProxy.DispatchTypeChangesAndClear (System.Type type) [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.PolySpatial.Internals.LocalAssetManager.ProcessChanges () [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.PolySpatial.Internals.PolySpatialUnitySimulation.UpdateInternal () [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.PolySpatial.Internals.PolySpatialUnitySimulation.Update () [0x00000] in <00000000000000000000000000000000>:0 
  at Unity.PolySpatial.Internals.PolySpatialCore.PolySpatialAfterLateUpdate () [0x00000] in <00000000000000000000000000000000>:0 
  at UnityEngine.LowLevel.PlayerLoopSystem+UpdateFunction.Invoke () [0x00000] in <00000000000000000000000000000000>:0 
Requested open window for: id -82 (desired: Unbounded)
Volume added: id -82 (desired: Unbounded)
TBB Global TLS count is not == 1, instead it is: 2
Matching windows and volumes -- 1 orphan volumes, 0 free windows, 0 total windows
Configuration Descriptor 0x0 (rank 0): Rotation and Orientation, 3D Body Tracking
UnityEngine.DebugLogHandler:Internal_Log_Injected(LogType, LogOption, ManagedSpanWrapper&, IntPtr)
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Debug:LogFormat(LogType, LogOption, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
UnityEngine.Debug:Log(Object)
UnityEngine.XR.ARSubsystems.XRSessionSubsystem:DetermineConfiguration(Feature)
UnityEngine.XR.ARSubsystems.XRSessionSubsystem:Update(XRSessionUpdateParams)
UnityEngine.XR.ARFoundation.ARSession:Update()

Using session configuration 0x0 (unchanged)
	Requested Features: (None)
	Supported Features: (None)
	Requested features not satisfied: (None)
UnityEngine.DebugLogHandler:Internal_Log_Injected(LogType, LogOption, ManagedSpanWrapper&, IntPtr)
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Debug:LogFormat(LogType, LogOption, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
UnityEngine.Debug:Log(Object)
UnityEngine.XR.ARSubsystems.XRSessionSubsystem:DebugPrintConfigurationChange(Configuration, Feature)
UnityEngine.XR.ARSubsystems.XRSessionSubsystem:Update(XRSessionUpdateParams)
UnityEngine.XR.ARFoundation.ARSession:Update()

AR authorization result - Type: Hand_Tracking Status: ar_authorization_status_not_determined
UnityEngine.DebugLogHandler:Internal_Log_Injected(LogType, LogOption, ManagedSpanWrapper&, IntPtr)
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Debug:LogFormat(LogType, LogOption, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
UnityEngine.Debug:Log(Object)
UnityEngine.XR.VisionOS.VisionOSSessionProvider:ProcessAuthorizationResult(IntPtr)
UnityEngine.XR.VisionOS.VisionOSSessionProvider:EnumerateAuthorizationStepCallback(IntPtr)
UnityEngine.XR.VisionOS.VisionOSSessionProvider:RequestAuthorizationResultsEnumerationCompletedCallback()
UnityEngine.XR.VisionOS.Authorization:UnityVisionOS_impl_ar_authorization_results_enumerate_results(IntPtr, Authorization_Results_Enumeration_Step_Callback, Authorization_Results_Enumeration_Completed_Callback)
UnityEngine.XR.VisionOS.VisionOSSessionProvider:QueryAuthorizationResultsHandler(IntPtr, IntPtr)
UnityEngine.XR.VisionOS.VisionOSSessionProvider:AuthorizationUpdateHandler(IntPtr)

New AR authorization required. Requesting authorization for Hand_Tracking.
UnityEngine.DebugLogHandler:Internal_Log_Injected(LogType, LogOption, ManagedSpanWrapper&, IntPtr)
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Debug:LogFormat(LogType, LogOption, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
UnityEngine.Debug:Log(Object)
UnityEngine.XR.VisionOS.VisionOSSessionProvider:RequestAuthorizationIfNeeded()
UnityEngine.XR.VisionOS.VisionOSSessionProvider:QueryAuthorizationResultsEnumerationCompletedCallback()
UnityEngine.XR.VisionOS.VisionOSSessionProvider:QueryAuthorizationResultsHandler(IntPtr, IntPtr)
UnityEngine.XR.VisionOS.Authorization:UnityVisionOS_impl_ar_authorization_results_enumerate_results(IntPtr, Authorization_Results_Enumeration_Step_Callback, Authorization_Results_Enumeration_Completed_Callback)
UnityEngine.XR.VisionOS.VisionOSSessionProvider:QueryAuthorizationResultsHandler(IntPtr, IntPtr)
UnityEngine.XR.VisionOS.VisionOSSessionProvider:AuthorizationUpdateHandler(IntPtr)

Scene will resign active: <UIWindowScene: 0x107831cb0; role: UISceneSessionRoleImmersiveSpaceApplication; persistentIdentifier: es.many-worlds.dpworldavp:SFBSystemService-6C22D154-E110-4500-9E04-355EDD45DB56; activationState: UISceneActivationStateForegroundActive>
AR authorization result - Type: Hand_Tracking Status: ar_authorization_status_allowed
UnityEngine.DebugLogHandler:Internal_Log_Injected(LogType, LogOption, ManagedSpanWrapper&, IntPtr)
UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Debug:LogFormat(LogType, LogOption, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
UnityEngine.Debug:Log(Object)
UnityEngine.XR.VisionOS.VisionOSSessionProvider:ProcessAuthorizationResult(IntPtr)
UnityEngine.XR.VisionOS.VisionOSSessionProvider:EnumerateAuthorizationStepCallback(IntPtr)
UnityEngine.XR.VisionOS.VisionOSSessionProvider:RequestAuthorizationResultsEnumerationCompletedCallback()
UnityEngine.XR.VisionOS.Authorization:UnityVisionOS_impl_ar_authorization_results_enumerate_results(IntPtr, Authorization_Results_Enumeration_Step_Callback, Authorization_Results_Enumeration_Completed_Callback)
UnityEngine.XR.VisionOS.VisionOSSessionProvider:RequestAuthorizationResultsHandler(IntPtr, IntPtr)
UnityEngine.XR.VisionOS.VisionOSSessionProvider:QueryAuthorizationResultsEnumerationCompletedCallback()

libc++abi: terminating due to uncaught exception of type Il2CppExceptionWrapper

Hi,

That one’s a tricky error…there are some workarounds you can try in order to address it however.

First off, what Unity editor version are you testing with? If you are on Unity 6000.0.0f1, try upgrading to 6000.0.6f1 or higher, where a breaking change related to authorization request callbacks was fixed.

The other thing you can try is ensuring, within the Build Profiles, you have set Run in Xcode as Release instead of as Debug.

Finally, you can try commenting out the OnEnable /OnDisable code in SampleUIController script in the samples to avoid this authorization issue.

For more details, please refer to the Known Issues section of the release notes.

Thanks!, problem solved, I share my result for other people
With this changes I can run the sample on metal mode, I share some screenshots to show the settings




If you have problems with passthrough (black screen appears when try to show it) add on scene a volume camera with the metal Volume type:
image
I share the code to make a smooth transition between skybox and passthrough:
In this script:
image
Comment onEnable and OnDisable code:

   // void OnEnable()
        // {
        //     VisionOS.AuthorizationChanged += OnAuthorizationChanged;
        // }

        // void OnDisable()
        // {
        //     VisionOS.AuthorizationChanged += OnAuthorizationChanged;
        // }

and change the toggle skybox function with this code

using System.Collections;


        [SerializeField] private Material m_SkyboxMaterial;
        [SerializeField] private float m_TransitionDuration = 1f;
        private bool m_IsTransitioning = false;

        public void ToggleSkybox()
        {
            if (!m_IsTransitioning)
            {
                StartCoroutine(m_Camera.clearFlags == CameraClearFlags.Skybox ? TransitionToPassthrough() : TransitionToSkybox());
            }
        }

        private IEnumerator TransitionToPassthrough()
        {
            m_IsTransitioning = true;

            // Fade out skybox
            float elapsedTime = 0f;
            float startExposure = m_SkyboxMaterial.GetFloat("_Exposure");

            while (elapsedTime < m_TransitionDuration / 2)
            {
                elapsedTime += Time.deltaTime;
                float t = elapsedTime / (m_TransitionDuration / 2);
                m_SkyboxMaterial.SetFloat("_Exposure", Mathf.Lerp(startExposure, 0f, t));
                yield return null;
            }

            // Switch to color clear mode
            m_Camera.clearFlags = CameraClearFlags.Color;
            m_Camera.backgroundColor = Color.black;

            // Fade to clear
            elapsedTime = 0f;
            while (elapsedTime < m_TransitionDuration / 2)
            {
                elapsedTime += Time.deltaTime;
                float t = elapsedTime / (m_TransitionDuration / 2);
                m_Camera.backgroundColor = Color.Lerp(Color.black, Color.clear, t);
                yield return null;
            }

            m_Camera.backgroundColor = Color.clear;

            if (m_FloorObject != null)
                m_FloorObject.SetActive(false);

            m_IsTransitioning = false;
            UpdateSkyboxToggleText();
        }

        private IEnumerator TransitionToSkybox()
        {
            m_IsTransitioning = true;

            if (m_FloorObject != null)
                m_FloorObject.SetActive(true);

            // Fade from clear to black
            float elapsedTime = 0f;
            while (elapsedTime < m_TransitionDuration / 2)
            {
                elapsedTime += Time.deltaTime;
                float t = elapsedTime / (m_TransitionDuration / 2);
                m_Camera.backgroundColor = Color.Lerp(Color.clear, Color.black, t);
                yield return null;
            }

            // Switch to skybox mode
            m_Camera.clearFlags = CameraClearFlags.Skybox;

            // Fade in skybox
            elapsedTime = 0f;
            float targetExposure = 1f;
            m_SkyboxMaterial.SetFloat("_Exposure", 0f);

            while (elapsedTime < m_TransitionDuration / 2)
            {
                elapsedTime += Time.deltaTime;
                float t = elapsedTime / (m_TransitionDuration / 2);
                m_SkyboxMaterial.SetFloat("_Exposure", Mathf.Lerp(0f, targetExposure, t));
                yield return null;
            }

            m_SkyboxMaterial.SetFloat("_Exposure", targetExposure);

            m_IsTransitioning = false;
            UpdateSkyboxToggleText();
        }

Result:

2 Likes

Hi,

Nice job on getting the sample to work - that pass-through → skybox transition looks amazing! And thank you for sharing the settings that worked for you!

Just a few points of clarification:

  • You can set the App Mode to Metal instead of Hybrid if you don’t plan on using any PolySpatial or RealityKit features, such as bounded volumes and visionOSHoverComponent, etc. It’s not necessary to be in Hybrid to get pass-through.
  • For the pass-through - if you are getting a black skybox instead of pass-through, ensure that HDR is disabled in your UniversalRenderPipeline Asset.

hello, I am also trying to replicate the sample on my Vision Pro, I have already set the HDR of URP asset setting to disable, but it still showed a black background when I tap the passthrough button.
People among the black back ground was split from the background, but the other area was still black.
What should I do to solve this problem, the other setting I just set as same as the pics Igarvi sent above.

awesome! Where can I find the Metal Camera Config? All I’m finding is Bounded and Unbounded. I have added the Metal Sample URP under Apple VisionOS XR Plugin.

You should be able to create a new one: Assets → Create → PolySpatial → Volume Camera Window Configuration (and then you can either set it as the default volume camera and/or refer to it in a Volume Camera component).

Great, thank you!!

1 Like

I got the passthrough to work! In theory, since it’s using Metal, will we be able to apply post process bloom to passthrough? I’ve gotten it to work in fully immersive but my test right now is disabling passthrough again.

Edit for clarity: Post processing bloom to a a game object with an emissive shader, not to the entire camera feed.

I’m having problems with passthrough in the visionOS simulator, I’ve done all the steps mentioned, but still when I try to show it I get a black screen. Does it only work on a real visionOS device?