Rufus31415 / Simple-WebXR-Unity

⭐ Bringing WebXR to Unity 3D ! B-)
https://rufus31415.github.io/webxr/MRTK-HandInteraction/
MIT License
573 stars 82 forks source link

AR Foundation Image Tracking Demo #15

Closed JanOwiesniak closed 3 years ago

JanOwiesniak commented 3 years ago

Hello there,

i forked Unity-Technologies/arfoundation-demos and setup the project in Unity 2019.4.13f1 as described here by adding the 3 mentioned files the Unity Asset folder and attachting SimpleWebXR MonoBehavior on a game object called WebAR to my scene (commit).

I fired up a simple HTTP Server python -m SimpleHTTPServer 8080 and a tunnel via ngrok http --host-header=rewrite 8080 to access index.html from my actual smartphone (Apple iOS) via a public URL.

The websites loads extremly slow (2-3 Minutes) with a 100Mbit internet connection. After loading finished, there is no camera image (just a black screen) with a Text saying "Wait for tracking to begin."

The Webserver also returns a 404:

GET /sharedassets0.resource              404 File not found

The file sharedassets0.resource is not part of the bundle (not sure if this is important).

Screenshot 2020-10-28 at 11 11 33

Here are my WebGL Player Settings (maybe i forgot a important checkmark somewhere?)

Screenshot 2020-10-28 at 11 21 02

Screenshot 2020-10-28 at 11 21 07

Sidenote: The arfoundation-demos are working as expected when i export the iOS and Android Player and run it on my test devices.

Rufus31415 commented 3 years ago

If I understand well, you have forked this project: https://github.com/Unity-Technologies/arfoundation-demos And you try to make it WebXR compatible. I don't know this project, but the message "Wait for tracking to begin" is part of this project: https://github.com/Unity-Technologies/arfoundation-demos/search?q=Wait+for+tracking+to+begin I suggest that you rather get closer to the members of this project so that they give the right approach to add a target to their lib. SimpleWebXR just returns the position of the smartphone in space as well as the position and state of the controllers.

JanOwiesniak commented 3 years ago

If I understand well, you have forked this project: https://github.com/Unity-Technologies/arfoundation-demos And you try to make it WebXR compatible.

You are correct. I cloned Unity-Technologies/arfoundation-demos and added your WebAR bridge Simple-WebXR-Unity to it to run it in WebGL.

I don't know this project, but the message "Wait for tracking to begin" is part of this project: https://github.com/Unity-Technologies/arfoundation-demos/search?q=Wait+for+tracking+to+begin

You are correct. "Wait for tracking to begin" is part of Unity-Technologies/arfoundation-demos

I suggest that you rather get closer to the members of this project so that they give the right approach to add a target to their lib.

Running the Unity-Technologies/arfoundation-demos directly on iOS (XCode Export) and Android (Android Studio Export) works as expected.

Running Unity-Technologies/arfoundation-demos together with your WebAR bridge via WebGL does not work.

Therefor i assume that the issue is related to this project (WebAR bridge via WebGL) and not with the demo itself.

SimpleWebXR just returns the position of the smartphone in space as well as the position and state of the controllers.

Are there any working image recognition / tracking examples based on your WebGL / WebAR bridge yet or is this the first one you heard of? Maybe SimpleWebXR needs to expose more than what you just mentioned to support image recognition?

Rufus31415 commented 3 years ago

WebXR is a standard defined by the W3C: https://www.w3.org/TR/webxr/ Currently, it does not support image recognition. SimpleWebXR exposes this WebXR javascript API in your Unity code.

JanOwiesniak commented 3 years ago

Currently, it does not support image recognition.

Thanks for the feedback. This is all i needed to know.

Rufus31415 commented 3 years ago

For image tracking, have a look at this project : https://ar-js-org.github.io/AR.js-Docs/