artoolkitx / arunityx

artoolkitX for Unity, providing high-performance video acquisition, marker and texture tracking and full Unity Editor support
https://www.artoolkitx.org/
Other
41 stars 22 forks source link

Please add support for "WebCamTexture" in unity #61

Open StartNight opened 1 year ago

StartNight commented 1 year ago

Please support "WebCamTexture" in unity. This allows more platforms to be supported. I've been looking into using ARtoolkitx to bring AR effects to more platforms. However, some platforms support a native API to capture the camera footage. While it's great to support Windows, Android, iOS in the ARtoolkitx source code, there are some platforms that don't support it. Use unity's 'WebCamTexture' to support many more platforms from the unity native code level. Please add this feature. Thanks!

philip-lamb commented 1 year ago

Support for external textures including WebcamTexture is planned.

StartNight commented 1 year ago

Thank you very much!

philip-lamb commented 1 year ago

First part is in #76

vizluk commented 4 months ago

Is Unity Webcamtexture support finished? I am using Unity on Mac, but instead of apple’s AVFoundation I prefer using unity webcamtexure.

After digging around the source code, I am able to find code related to “unity video source” here and there. It seems like all the functions needed are there but I could not make it work.

I tried things below but got no luck. — Manually override the config to “module=External -nocopy” — Call arwVideoPushInit manually.

If Webcamtexture support is finished can you provide documentation or guidance for proper way to set it up?

BTW, really appreciated your detailed work. Thank you in advance.

philip-lamb commented 4 months ago

It's not complete yet, although most of the underlying pieces needed for it are. I'll do a quick review and see what's needed.

vizluk commented 4 months ago

You are awesome!

vizluk commented 3 months ago

While waiting for your update I read through previous documentation and got a basic understanding of how the start sequence might work.

So I disabled Auto-start AR, and executed following code trying to establish external video source.

ARXController.Instance.PluginFunctions.arwStartRunningB("-module=External -nocopy",null,0); ARXController.Instance.PluginFunctions.arwVideoPushInit(0,1920,1080,"RGBA",0,0)

However, every time I run till the second line arwVideoPushInit the Unity crashes with no error message. I was on M1 Mac using Unity 2023, then tried intel Mac with Unity 2021 LTS, still got the same issue.

Am I doing the external video setup wrong? Can you give me a simple guidance on steps to set it up?