Three.js: Oculus Quest VR: texImage3D is not a function

Created on 14 Dec 2019  路  25Comments  路  Source: mrdoob/three.js

Description of the problem

When calling render with
renderer.vr.enabled = true;
on Oculus quest, you get the error:

Error message: Uncaught TypeError: texImage3D is not a function
URL: three.js 
Line Number: 22118

This appears to be related to multiview which I presume is used for VR now.

This issue is very recent. Yesterday before my Oculus Quest automatically updated itself, I was able to run my VR game fine on it. After the update, I had to switch to using XR instead. I downloaded the latest build of three.js. Now whenever vr.enabled === true I get this error.

Three.js version
  • [x] Dev
OS
  • [x] Android

Most helpful comment

7.1 should be released this week, btw.

All 25 comments

Do you get that error with the examples too?
https://threejs.org/examples/?q=webxr_vr

Some of the examples still work, like ballshooter. Others are just black when you enter VR, like multiview.

I don't have remote debugging right now so I can't tell what the error message is.

Coul you be a bit more specific? Which ones do not work?

I tried them all. All but the multiview/panorama and video examples work. Although the panorama and video examples don't even work in non-VR mode.

I've also tested all VR examples on a Quest today and the following do not work:

  • webxr_vr_multiview
  • webxr_vr_panorama
  • webxr_vr_panorama_depth
  • webxr_vr_video

In case of webxr_vr_panorama, webxr_vr_panorama_depth and webxr_vr_video the mentioned runtime error looks like so:

image

The code breaks here:

https://github.com/mrdoob/three.js/blob/99b8caf90ffd380336ae835f9623dcb86c4b457b/src/renderers/webgl/WebGLTextures.js#L1064

webxr_vr_multiview logs a different error:

image

@fernandojsg Do you think this is an implementation problem of the Oculus browser?

I haven't checked the latest update on the Oculus Browser when they enabled WebXR, not sure if that's related. Maybe they enabled OVR_multiview2 somehow by default?
I'll try it on the quest and see if I can find something
/cc @Artyom17

It seems that both OCULUS_multiview and OVR_multiview2 are enabled by default on Oculus Browser, and by the log that you shared it seems that both are using multisampled fbo, when just the OCULUS_multiview should be using multisampled fbo.

My whole site croaked the other day for all my customers using Ouclus HMDs after Oculus pushed that update. It affects Go's as well. I had to do an emergency patch where I simply did the ol' classic:
function WebGLMultiview( renderer, gl ) { function isAvailable() { return false; .....
Until I can sort something a bit more solid out :)

I just noticed they are also exposing OVR_multiview2 in WebGL1 contexts which shouldn't be the case as that extension is defined to be used just with WebGL2 contexts, that's you get the texImage3D errors as you are using WebGL1 but it shows OVR_multiview2 defined so it just jump on the multiview code to create the texture array.
So I believe we should not patch the code and just wait for oculus to fix it on their browser.

Let me check really quick, I'll report back.

@Donitzo: can you try to disable multiview in chrome://flags and try again? This should mitigate the issue for now. I am investigating.

Here's some version numbers from the Go, as well as confirmation that OVR_multiview2 is showing up in WebGL1... check out the very bottom.
Screen Shot 2019-12-16 at 5 08 27 PM
Screen Shot 2019-12-16 at 5 08 05 PM

Ok, I've fixed the original issue with the texImage3D and other non-working samples, and yes, that was a bug (reporting OVR_multiview2 as supported for WebGL 1). This fix will be shipped in 7.1 ASAP.

However, the multiview test case still doesn't work because seems like blitFramebuffer is called on a multisampled framebuffer. I am still investigating this part.

Ok... For the blitFramebuffer issue. This is a bit confusing one. The issue is that the Browser "thinks" that it is composing into a multisampled framebuffer, even, though, the context was clearly setting "antialiasing" attribute to false in webxr_vr_multiview.html. The reason why it is doing that is this line in WebXRManager.js:

session.updateRenderState( { baseLayer: new XRWebGLLayer( session, gl ) } );

Note, that no init object is used here. However, the default one will be used, and this is where it becomes interesting.

The default XRWebGLLayer's init object has default values for all attributes (from https://www.w3.org/TR/webxr/#xrwebgllayer-interface):

dictionary XRWebGLLayerInit {
  boolean antialias = true;
  boolean depth = true;
  boolean stencil = false;
  boolean alpha = true;
  boolean ignoreDepthValues = false;
  double framebufferScaleFactor = 1.0;
};

The default value of 'antialias' for the layer is true! And check the step #9 here, it suppose to take the AA attribute from the init object, not from the context ("composition disabled" is set to false in this case).

What should be done here is to change that line in WebXRManager.js to something like this:

session.updateRenderState( { baseLayer: new XRWebGLLayer( session, gl, { antialias: gl.getContextAttributes().antialias } ) } );

See PR https://github.com/mrdoob/three.js/pull/18178

CC /@mrdoob @fernandojsg

@Artyom17 nice catch on the layers' attributes! It totally makes sense.
thanks for looking into this so quickly 馃憤

@fernandojsg, I've uploaded a 7.1.2 build into BETA channel (you are on that channel, afaics), you may test the "multiview in webgl 1" fix with the Panorama example.

@fernandojsg, I've uploaded a 7.1.2 build into BETA channel (you are on that channel, afaics), you may test the "multiview in webgl 1" fix with the Panorama example.

Yep, I see it on "My previews apps" as "installed" but when I launch the browser it's still on v7.0 Any idea how can I upgrade it?

@fernandojsg, go to "Store", find "Oculus Browser", click on it, select "View app details", this should open a browser's info page and there should be a button "Update" there.

That was I was trying to do, but I just see "Start" no "Update" there :-\
com oculus vrshell-20191217-113453
com oculus vrshell-20191217-113519
com oculus vrshell-20191217-113528

Sorry for hijacking the thread with this :)

Maybe I'm on the alpha channel and this one has been released on the beta channel, or the other way around?

No, you are on beta. Weird, my Store looks different. Don't really understand why. If you go to "Library", do you see Oculus Browser in "Updates" tab?

I am also sending you the APK to your gmail email.

Weird, my Store looks different

fwiw I'm on v12 (System Version 43426000...)

If you go to "Library", do you see Oculus Browser in "Updates" tab?

Nop

I am also sending you the APK to your gmail email.

Thanks! I'll try that

I just tested the apk and I can confirm OVR_multiview2 is not exposed in the WebGL1 context, and multiview is working as expected with no antialias context (Using this PR: https://github.com/mrdoob/three.js/pull/18178).
I have tried also the rest of the examples and all of them works fine on the v7.1
Thanks @Artyom17 馃憤

7.1 should be released this week, btw.

Was this page helpful?
0 / 5 - 0 ratings