Warnings in console on Quest when WebXR layers are enabled.
See original GitHub issueDescribe the bug
WebGL: INVALID_OPERATION: drawBuffers: COLOR_ATTACHMENTi_EXT or NONE
warning each frame when WebXR layers are enabled.
To Reproduce
Steps to reproduce the behavior:
- Use an Oculus Quest with WebXR layers enabled
- Attach a Chrome debugger to the Quest browser
- Go to https://threejs.org/examples/?q=layer#webxr_vr_layers and enter VR
- See warnings in log followed by
WebGL: too many errors, no more errors will be reported to the console for this context.
Code
I’m not familiar enough with Three.js to submit a fix for this, but I tracked down the issue to WebGLRenderer.js. If you add if (!xr.isPresenting) {
around the code that sets _currentDrawBuffers[ 0 ] = _gl.BACK;
, the warnings go away. This call interferes with the gl.framebufferTexture2D( gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0,... );
in WebXRManager
. Ideally, the check would be something like if (!xr.isPresenting || !areWebXrLayersEnabled)
, but I’m not sure what cleanest way is for determining if XR layers enabled in that class.
Platform:
- Device: Quest 2
- OS:
oculus/hollywood/hollywood:10/QQ3A.200805.001/17007100222900000:user/release-keys
- Browser:
Mozilla/5.0 (X11; Linux x86_64; Quest 2) AppleWebKit/537.36 (KHTML, like Gecko) OculusBrowser/16.1.0.3.48.300946211 SamsungBrowser/4.0 Chrome/91.0.4472.114 Safari/537.36
- Three.js version: r130
Issue Analytics
- State:
- Created 2 years ago
- Comments:16 (12 by maintainers)
Top Results From Across the Web
WebXR Layers - Oculus Developer
Describes how to use WebXR Layers for increased web performance, high-quality video, and images.
Read more >WebXR Device API: Accessing Virtual Reality and Augmented ...
1. Check to see if the user's device and browser are both capable of presenting the XR experience you want to provide. Make...
Read more >WebXR Device API - W3C
The WebXR Device API provides the interfaces necessary to enable developers to build compelling, comfortable, and safe immersive ...
Read more >1088046 - isSessionSupported deos not find "immersive-vr ...
isSessionSupported('immersive-vr').then((session) => {console.log(session)}) returns false at all times. Previously flags to enable ...
Read more >aframe/CHANGELOG.md - UNPKG
39, AR, hand tracking, compositor layers, immersive navigation (Quest only), ... for [WebXR compositor layers API](https://immersive-web.github.io/layers/) ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mrdoob #22558 will fix this issue. Who would be best to look at this change? I had a couple of people look at it internally but they are not as familiar with three.
I investigated this as part of https://github.com/google/model-viewer/discussions/2769#discussioncomment-1307863 , it also happens in <model-viewer> when rendering shadows.
If I’m understanding it right, the problem is that GL_BACK is only valid for drawBuffers when using the default framebuffer. However, state.bindFramebuffer(…, null) has an override to use the XR opaque framebuffer instead of the default framebuffer, and that’s a bound FBO for which GL_BACK is not valid.