Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebXR Fails to Load #102

Open
TylerSeppala opened this issue Jan 19, 2022 · 6 comments
Open

WebXR Fails to Load #102

TylerSeppala opened this issue Jan 19, 2022 · 6 comments

Comments

@TylerSeppala
Copy link

Hi,

I just did a build of Platform::EmscriptenApplication and it works just fine with the default "myApplication" project and the triangle example, displaying them correctly in the browser. However, I run into an issue when I attempt to build the WebXR example.

The project compiles just fine without any errors, and when I run it on a local server, it displays the expected page in the browser, even showing the correct scene in the small window. But when I try to enter the scene in VR, I just get an infinite loading screen, and the console outputs this error:

Uncaught (in promise) ReferenceError: dynCall is not defined
at onSessionStart (magnum-webxr.js:6534)
at onSessionStarted (magnum-webxr.js:6597)

onSessionStart @ magnum-webxr.js:6534
onSessionStarted @ magnum-webxr.js:6597
Promise.then (async)
Module.webxr_request_session_func @ magnum-webxr.js:6620
_webxr_request_session @ magnum-webxr.js:6638
$func216 @ magnum-webxr.wasm:0x6812
$func308 @ magnum-webxr.wasm:0x9c50
mouseEventHandlerFunc @ magnum-webxr.js:4677
jsEventHandler @ magnum-webxr.js:4499

I also get a similar error when I exit the session. I'm attempting to view this using port forwarding on a Quest 2, and the CMake commands I'm using are:

mkdir build-emscripten && cd build-emscripten
cmake ..
-DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/Emscripten-wasm.cmake"
-DCMAKE_PREFIX_PATH="/home/tseppala/.emsdk/upstream/emscripten/system"
-DCMAKE_INSTALL_PREFIX=/mnt/h/CodeTests/MagServer
cmake --build .
cmake --build . --target install

Did I forget to include something in my build? Is this a problem with my Emscripten installation? Or am I just typing the wrong commands?

Any help would be greatly appreciated.

@Squareys
Copy link
Contributor

Squareys commented Jan 19, 2022

Hi @TylerSeppala !

I saw the email first and replied there, but here's a summary for anyone who comes across this issue:

  • library_webxr.js is from emscripten-webxr, which has received some updates, but nothing directly relating to the dynCall() error you have here. You might find useful cmake flags there and using that repository as a subproject allows you to link to it like a static library.
  • Port forwarding should not be related here, that works fine with emscripten-webxr.

Which emscripten version are you using?

@TylerSeppala
Copy link
Author

Alright, good to know. I'm using emscripten 3.1.1

@TylerSeppala
Copy link
Author

New developments:

I just decided to go all the way back to emscripten v1.39.4 because that was the version around the time this code was written... and it kind of works. I can now enter VR and see everything just fine, but it seems that shading isn't working properly. The sides of the cubes that are supposed to have any amount of shadow are completely black.

So it seems the problem is definitely surrounding the emscripten version. Maybe I just need to find the right version?

@TylerSeppala
Copy link
Author

This is the new error I'm getting... mean anything to anyone?

Uncaught TypeError: Cannot read properties of null (reading 'transform')
at _webxr_get_input_pose (magnum-webxr.js:6621)
at magnum-webxr.wasm:0x4032
at magnum-webxr.wasm:0x72fd
at magnum-webxr.wasm:0x3874
at magnum-webxr.wasm:0x4afef
at Module.dynCall_viiii (magnum-webxr.js:7156)
at dynCall (magnum-webxr.js:538)
at XRSession.onFrame (magnum-webxr.js:6698)

@Squareys
Copy link
Contributor

Whew, so much trouble, I wonder how this is working so well for us 🤔
We're on 2.0.23 at the moment. With a bit of luck that might the version that works for you, too?

@TylerSeppala
Copy link
Author

Thanks, I'll definitely try that in the morning!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants