#Quest vs WebXR emulator addon

35 messages · Page 1 of 1 (latest)

ruby delta
#

Heya, my app has been working fine while developing using the https://addons.mozilla.org/en-US/firefox/addon/webxr-api-emulator/ addon; my test cube and renderer background renders fine.
However when I run the app in quest 2 browser nothing is visible - not the test cube nor the renderer background - everything is just black.

Unsure what parts of my code is relevant so I don't know what to send, sorry.

Download WebXR API Emulator for Firefox. Emulate WebXR devices on your browser

#

no errors in console either on quest

ruby delta
#

however this warning does show up on quest hmmm

#

this comes up as well now

ruby delta
#

switching to the browsers requestAnimationFrame does not work either.

Got a friend to test on Edge and it just crashes edge every time the "start vr" button is pressed. panic

ruby delta
#

Tested a few variations with no changes (didn't check logs however):

  • Make sure WebGLRenderer.render only gets called after WebXRManager.setSession finished
  • Turned on/off cameraAutoUpdate
  • Removed/added setClearColor (color doesn't get renderered)

I'm genuinely so confused

ruby delta
scenic crest
#

What is 'loop.ts' and why is it producing that error?

ruby delta
scenic crest
ruby delta
scenic crest
scenic crest
#

I'm trying to figure out what those errors mean, it's just the Microsoft crud is confusing and I want to make sure it's not relevant
It looks like a texture issue, but I don't have much of a clue apart from that.
My best advice, and what I had to do when publishing VR to web, was to start with a very minimal example, get something simple running without errors and add things back until it breaks.

ruby delta
#

That was what I was doing; however I was testing using the webxr emulator

scenic crest
#

Oh it's source mapping to the ts file. Gotcha.
(I don't use any of that stuff, JS is quite complex enough)

scenic crest
#

At the moment all i can suggest is updating your quest OS and finding a basic example that works on the device.
there are known issues with three postprocessing only working in emulator and not on the device, but it doesn't sound like thats the problem here.

ruby delta
#

Is bad webxr support on the quest the issue or how is this.. Breaking at all?

ruby delta
#

right continuing as im home again and can test things

@scenic crest minimal reproducible example:

<script lang="ts">
    import { onMount } from "svelte";
    import { Scene, PerspectiveCamera, BoxGeometry, Group, Mesh, WebGLRendererfrom "three";

    // State
    let renderer: WebGLRenderer | undefined;
    let scene: Scene | undefined;
    let camera: PerspectiveCamera | undefined;
    let frameRequest: ReturnType<typeof requestAnimationFrame> | undefined;

    onMount(() => {
        scene = new Scene();
        renderer = new WebGLRenderer();
        camera = new PerspectiveCamera();
        scene.add(camera);

        let group = new Group();
        scene.add(group);
        let geom = new BoxGeometry(1, 1, 1);
        let mesh = new Mesh(geom);
        mesh.position.set(1, 0, 0);
        group.add(mesh);

        return () => {
            if (frameRequest !== undefined) {
                cancelAnimationFrame(frameRequest);
            }
        }
    });
    function render(): void {
        console.log("render");
        frameRequest = requestAnimationFrame(render);

        renderer!.render(scene!, camera!);
    }
    async function startVR(): Promise<void> {
        let sessionOptions: XRSessionInit = {
            optionalFeatures: [
                "local-floor",
                "bounded-floor",
                "hand-tracking",
                "layers"
            ]
        };
        let xrSession = await navigator.xr!.requestSession("immersive-vr", sessionOptions);
        renderer!.xr.enabled = true;
        renderer!.xr.setSession(xrSession);

        frameRequest = requestAnimationFrame(render);
    }
</script>

<button onclick={startVR}>Start VR</button>

The cube will be perfectly visible in the emulator addon however completely invisible on the quest for me

#

noticed I was 1 version behind threejs on npm so updated; made no difference

ruby delta
#

Managed to get my demo page working; you need to use XRSession.requestAnimationFrame or it won't render at all on the quest (even if your function is called)

#

will see if it translates to my actual app

ruby delta
#

it did work on quest. Waiting for friend to get home to see if it fixes edge crash

scenic crest
#

Huh? I don't remember having to use that (It's been a while since I did this)
Nor should it work in the emulator if it's required.
Glad you're getting somewhere though, thanks for the update.

ruby delta
#

Alright so it does work perfectly fine in emulator and on quest now, however a new challenger is here to fuck up my day:

If my game is run on edge it crashes the entire browser.

#

This doesn't seem to be a one person thing either as multiple of our testers are crashing running it on edge

scenic crest
#

@ruby delta
Does it work in Chrome? (Edge is based on Chrome now)
Have you checked the browser permission settings for VR?
There have been issues with Edge in the past, MS manage to make a mess of it even though it's chrome under the hood.
Can you finds examples of A) webXR content and B) Three.js webXR content that work in Edge?
If not, it's a browser issue, if not B, it might be a three issue. And if there are then you may be doign somethign wrong still (but I doubt it)

ruby delta
# scenic crest <@397745647723216898> Does it work in Chrome? (Edge is based on Chrome now) Hav...

Does it work in Chrome? (Edge is based on Chrome now)
Yup!
Have you checked the browser permission settings for VR?
While I don't have edge to test, one of my friends did get a permission popup and when he pressed allow edge crashed.
Ill see about getting some more help testing edge on this

A) webXR content and B) Three.js webXR content that work in Edge?
Moonrider apparently works in edge without issues

But weird though, no browser should crash regardless of how broken my code is thonkline

scenic crest
# ruby delta > Does it work in Chrome? (Edge is based on Chrome now) Yup! > Have you checked ...

Well, maybe make sure the browser is set to allow by default.
Moonrider uses A-frame, which is based on three.js, though how and to what extent it implements three's webxr is unclear.
You should probably test this yourself, moonrider working in edge could be old news, problems could simply be unreported.
But you're right, it shouldn't be crashing.
Honestly I wouldn't be concerned with Edge. It's not the only thing that only works in certain browsers, Chrome being the most reliable
WebGPU is chrome only right now. The controller API is a bit broken in Firefox, and Web Audio is glitchy in it as well.
These issues are sometimes OS dependent as well. Firefox on linux != Firefox on windows.
But Edge, like everything that MS brings to the internet table, is a mess, sometimes intentionally as well.

#

(The irony of you using Typescript should be noted here. It would be on-brand for MS if TS transpiled code and Edge don't play well with each other. I think Edge has been know to act up with source maps.)

ruby delta
#

The controller API is a bit broken in Firefox
plump_wtf from our testing webxr isn't implemented on firefox on linux nor windows. Might be locked behind a feature flag ig, which makes it uh not really usable by our users.

Well, maybe make sure the browser is set to allow by default.
Will do!

Honestly I wouldn't be concerned with Edge.
:/ despite MS & edge being a bitch to deal with I would love to work on edge considering it's the default browser on windows
Browsers is a mess I guess. panic this is why I don't like frontend dev

(The irony of you using Typescript should be noted here. It would be on-brand for MS if TS transpiled code and Edge don't play well with each other. I think Edge has been know to act up with source maps.)
mmLul neat to know

#

this is the results of our browser testing from windows users

#

Anyway thanks so much for helping getting it working on quest browser and chrome ❤️ tysm

ruby delta