three.js: Oculus Quest VR: texImage3D is not a function
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
- Dev
OS
- Android
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 25 (2 by maintainers)
7.1 should be released this week, btw.
I just tested the apk and I can confirm
OVR_multiview2is 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 šLet me check really quick, Iāll report back.
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):
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:
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 š
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.
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.

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