I found a page about PolySpatial WebCamTexture Support for version 1.2.3
I tried it, but I got errors on Xcode.
Unity 2022.3.19f1
Xcode 15.3.0
PolySpatial 1.2.3
My Question is
How can I solve the errors?
I believe accessing external camera is not available for third party developers. What can I get using the WebCamTexture?
ina
May 9, 2024, 5:01am
3
which webcam does this take the input from? afaik camera api is not open on visionos?
@from2001vr did you test that with vision OS 1.1 or 1.2 beta?
I will also be really interested by this feature, sounds interesting.
@AndrzejUnity , @DanMillerU3D , @IsaacsUnity any news and info about that?
upcoming feature ?
which camera from the vision pro can you access with webcam texture ?
Rather than actually accessing one of the Vision Pro’s real camera feeds, I believe the WebCamTexture provides a feed of the user’s Persona (similar to what you would use for, say, Zoom). I haven’t tested it personally, though.
Thanks @AndrzejUnity for confirming !
glfff
July 9, 2024, 1:38pm
7
I have experienced similar issue with same version of polyspatial, with setting of external camera, e.g. FaceTime HD Camera of Mac. Could anyone please help with this issue? @AndrzejUnity @Raphael-PTC
I have followed the manual page of PolySpatial WebCamTexture and still get error which indicates WebCamTexture may not be correctly registered in the core of PolySpatial:
KeyNotFoundException: The given key 'UnityEngine.WebCamTexture' was not present in the dictionary.
System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) (at <24895ab5717c46559ecc60ae3bf90417>:0)
Unity.PolySpatial.Internals.LocalAssetManager.RegisterFirstReference (Unity.PolySpatial.Internals.AssetRepresentation representation) (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/AssetManagement/LocalAssetManager.cs:452)
Unity.PolySpatial.Internals.LocalAssetManager.RegisterInternal (UnityEngine.Object resource, Unity.PolySpatial.Internals.PolySpatialAssetID assetID) (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/AssetManagement/LocalAssetManager.cs:370)
Unity.PolySpatial.Internals.LocalAssetManager.Register[T] (T resource) (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/AssetManagement/LocalAssetManager.cs:312)
Unity.PolySpatial.Internals.LocalAssetManager.TryUpdateAssetRegistration[U] (U resource, Unity.PolySpatial.Internals.PolySpatialAssetID& id) (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/AssetManagement/LocalAssetManager.cs:673)
Unity.PolySpatial.Internals.PolySpatialUnityTracker.TryUpdateAssetRegistration[U] (U resource, Unity.PolySpatial.Internals.PolySpatialAssetID& id) (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/Trackers/PolySpatialUnityTracker.cs:283)
Unity.PolySpatial.Internals.CanvasRendererTracker.TransferCanvasRenderData (UnityEngine.CanvasRenderer cr, Unity.PolySpatial.Internals.TrackingData`1[Unity.PolySpatial.Internals.PolySpatialCanvasRendererTrackingData]* trackingData, Unity.PolySpatial.Internals.IChangeListWritable`1[TEngineData] changedData, Unity.PolySpatial.Internals.IChangeListWritable`1[TEngineData] destroyedData, System.Boolean startDirty) (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/Trackers/CanvasRendererTracker.cs:241)
Unity.PolySpatial.Internals.CanvasRendererTracker.TransferObjectData (UnityEngine.CanvasRenderer source, Unity.PolySpatial.Internals.TrackingData`1[Unity.PolySpatial.Internals.PolySpatialCanvasRendererTrackingData]* trackingData, Unity.PolySpatial.Internals.IChangeListWritable`1[TEngineData] changedData, Unity.PolySpatial.Internals.IChangeListWritable`1[TEngineData] destroyedData) (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/Trackers/CanvasRendererTracker.cs:84)
Unity.PolySpatial.Internals.UnityObjectTrackerWithTableDataAndEmptyRemovedData`3[TObject,TEngineData,TTrackingData].TransferObjectData (TObject source, TTrackingData* trackingData, Unity.PolySpatial.Internals.IChangeListWritable`1[TEngineData] engineData) (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/Trackers/UnityObjectTracker.cs:95)
Unity.PolySpatial.Internals.UnityObjectTracker`4[TObject,TEngineData,TRemovedData,TTrackingData].TransferObjectData (TObject source, TTrackingData* trackingData) (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/Trackers/UnityObjectTracker.cs:280)
Unity.PolySpatial.Internals.UnityObjectTracker`4[TObject,TEngineData,TRemovedData,TTrackingData].TransferObjectAndUpdateTrackingData (UnityEngine.Object o, TTrackingData* data) (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/Trackers/UnityObjectTracker.cs:581)
Unity.PolySpatial.Internals.CanvasRendererTracker.TrackNewAndModifiedObjects (UnityEngine.Object[] changedObjects) (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/Trackers/CanvasRendererTracker.cs:147)
Unity.PolySpatial.Internals.UnityObjectTracker`4[TObject,TEngineData,TRemovedData,TTrackingData].FetchTypeCallback (Unity.PolySpatial.Internals.ObjectDispatcherProxy+TypeDispatchData data) (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/Trackers/UnityObjectTracker.cs:375)
Unity.PolySpatial.Internals.ObjectDispatcherProxy.<.ctor>b__12_0 (UnityEngine.TypeDispatchData real) (at ./Library/PackageCache/com.unity.polyspatial/Runtime/InternalBridge/BridgeUtils.cs:129)
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) (at /Users/bokken/build/output/unity/unity/Runtime/Export/Misc/ObjectDispatcher.bindings.cs:175)
UnityEngine.ObjectDispatcher:DispatchTypeChangesAndClear(Type, Action`1, Boolean, Boolean)
Unity.PolySpatial.Internals.ObjectDispatcherProxy:DispatchTypeChangesAndClear(Type, Action`1) (at ./Library/PackageCache/com.unity.polyspatial/Runtime/InternalBridge/BridgeUtils.cs:191)
Unity.PolySpatial.Internals.UnityObjectTrackerBase:FetchDirtyOneTypeIntoLists(Type) (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/Trackers/UnityObjectTracker.cs:30)
Unity.PolySpatial.Internals.UnityObjectTracker`4:TrackObjectChanges(LayerMask) (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/Trackers/UnityObjectTracker.cs:355)
Unity.PolySpatial.Internals.PolySpatialUnityTracker:TrackObjectChanges(LayerMask) (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/Trackers/PolySpatialUnityTracker.cs:218)
Unity.PolySpatial.Internals.PolySpatialUnitySimulation:UpdateInternal() (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/Trackers/PolySpatialUnitySimulation.cs:198)
Unity.PolySpatial.Internals.PolySpatialUnitySimulation:Update() (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/Trackers/PolySpatialUnitySimulation.cs:159)
Unity.PolySpatial.Internals.PolySpatialCore:PolySpatialAfterLateUpdate() (at /Users/bokken/build/output/unity/quantum/Packages/com.unity.polyspatial/Runtime/PolySpatialCore.cs:669)
The documentation says to add POLYSPATIAL_ENABLE_WEBCAM to the Player defines, but given the way that we build the PolySpatial packages (to DLLs, with all #defines set during the build process), I have a feeling that that’s not going to work, and that webcam support is just broken at the moment. It would help if you could submit a bug report with a repro case of this and let us know the incident number (IN-#####) so that we can track it. Regardless, though, I’ll make a note to revisit this in a future version.
ina
July 10, 2024, 6:38am
9
which version of polyspatial/visionos supports a non-black webcam texture feed?
ina
July 10, 2024, 6:39am
10
which version of polyspatial supports returning the persona from a webcam texture?
As I just said, I believe webcam support is currently broken. We will endeavor to get it working in a future version.
Apple released Main camera access feature for enterprise developer at WWDC last month.
But the API of the feature is just for Swift and Xcode.
So, I implemented a bridge plugin for Unity.
glfff
July 21, 2024, 9:58pm
13
Thanks for the shared info. As a side product of this template here, I see webcamTexture is firstly copied to Texture2D then applied. In my case, I would like to stream from Mac to Vision Pro as well as have some interaction, do you think it would be a bottle neck with this CPU copy solution?
If the WebCamTexture support were actually working, when in-process (that is, using an actual build, rather than Play to Device), we would be transferring a native texture ID and doing a GPU blit (via RealityKit’s DrawableQueue ) rather than copying the pixels on the CPU. That’s the way we currently handle RenderTextures, and it performs much better than copying via the CPU.
Hello, it’s been six months now. Are there any cases of PolySpatial running Persona by WebCamTexture? Or is there clear support for Persona?
As I mentioned in the other thread, we support them via WebCamTexture . As mentioned on that page, you need to set POLYSPATIAL_ENABLE_WEBCAM to use it.