question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Warnings in console on Quest when WebXR layers are enabled.

See original GitHub issue

Describe 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:

  1. Use an Oculus Quest with WebXR layers enabled
  2. Attach a Chrome debugger to the Quest browser
  3. Go to https://threejs.org/examples/?q=layer#webxr_vr_layers and enter VR
  4. 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:closed
  • Created 2 years ago
  • Comments:16 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
cabaniercommented, Sep 23, 2021

@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.

2reactions
klauswcommented, Sep 10, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found