Azure / azure-spatial-anchors-samples

Azure Spatial Anchors sample code
Other
293 stars 138 forks source link

Any chance for Unity support WITHOUT ARFoundation as a requirement? #397

Closed SimonDarksideJ closed 1 year ago

SimonDarksideJ commented 1 year ago

Our projects are looking to move beyond ARFoundation support for various reasons, but we'd like to somehow retain support for Azure Spatial Anchors within Unity.

Is there any chance or roadmap that is likely to support Azure Spatial Anchors in Unity without the dependency on ARFoundation?

darax commented 1 year ago

ARFoundation is a pretty firm dependency of ASA on unity. If Unity provides another way of getting ARCore running, and you can get the ARSession and send us ARFrames it would in theory still work.

SimonDarksideJ commented 1 year ago

Other solutions like ARToolkitX and Niantic Lightship seem to do well without ARFoundation, but it's a shame that ASA cannot function without it as it creates a barrier for developers wanting to combine technologies. Sure I could write my own C++ lib to get the data, but that is a burden I don't have the time for at the moment and it is simply easier to use a competitor's technology instead, which is frustrating.

darax commented 1 year ago

How are you getting the ARFrames and doing other AR related things in this case? If you are already creating a session and presenting camera frames to the device, you should be able to call our APIs. The only code you should need to implement is C# scripts that interop between Unity and the native platform.

Lightship looks to be an alternative to ARFoundation-it drives ARCore/ARKit. It doesn't look like you could have both lightship and arfoundation. Glancing through their API it looks like they do not provide a way to get the raw platform pointers, such as the native pointer to the ARKit ARSession. This would make connecting lightship to ASA difficult.

SimonDarksideJ commented 1 year ago

How are you getting the ARFrames and doing other AR related things in this case? If you are already creating a session and presenting camera frames to the device, you should be able to call our APIs. The only code you should need to implement is C# scripts that interop between Unity and the native platform.

That is what I would go for, but you cannot currently compile without ARFoundation as the package lists it as a dependency.

Lightship looks to be an alternative to ARFoundation-it drives ARCore/ARKit. It doesn't look like you could have both lightship and arfoundation. Glancing through their API it looks like they do not provide a way to get the raw platform pointers, such as the native pointer to the ARKit ARSession.

Lightship simply uses ARCore under the hood using the native ARCore/ARKit DLLs. However, this means you need to remove/disable the Unity ARCore/Kit packages which are mandatory currently with the ASA versions and cause duplicate dll errors.

But lightship is just an example, ultimately ASA should be able to accept frames from any source with a list of requirements in the frame, or ARCore/Kit pointers, rather than a hard dependency on just Unity's ARFoundation.

but it sounds more like something that the MS team are not invested in, which is not a bad thing in the current climate. This just means developers need to use the native packages manually to use any other pattern.