New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warnings in console on Quest when WebXR layers are enabled. #22079
Comments
Can you please try the |
Closing. We can reopen the issue if this still happens with the latest |
This is still happening as of 10 hours ago using 8837fac https://sxp.me/three.js/examples/webxr_vr_layers.html uses that dev build and shows warnings when you enter VR on the Quest. |
Can you please test again on |
This is still happening but #22145 fixes the warnings. |
I investigated this as part of google/model-viewer#2769 (reply in thread) , 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. |
@takahirox I think this issue comes from the MRT code. |
We attempt to set draw buffers matching to a framebuffer when we switch render target and framebuffer in https://github.com/mrdoob/three.js/blob/r132/src/renderers/WebGLRenderer.js#L1904-L1968 But https://github.com/mrdoob/three.js/blob/r132/src/renderers/webxr/WebXRManager.js#L624 I speculate this is the cause. A solution may be moving the draw buffer update code to |
@cabanier Is it possible to use |
I will try that |
We're hitting this issue with the current release; can anyone confirm if #22558 should already be in effect? It seems that after XR working for a while, at some point it simply stops working (always not working when the warning "three.module.js:27039 WebGL: INVALID_OPERATION: drawBuffers: COLOR_ATTACHMENTi_EXT or NONE" is logged), and then only a browser restart brings XR back (even closing the tab and reopening it doesn't always fix the issue). Also happy to open another issue with this if it might be separate (WebXR in threejs breaking randomly when this warning shows up and then not recovering). (in case that matters, happens in Chrome with Quest + Link) |
Does that mean it doesn't happen on Quest? |
That sounds great – I'll make sure to try to have clear repro steps and post here tomorrow @cabanier. What I can already say is that it does not trivially reproduce with e.g. https://immersive-web.github.io/webxr-samples/spectator-mode.html (which would have been surprising), so might be a threejs issue with ordering etc. Some initial info: we're seeing slightly different issues on Quest and via Quest + Link, but most of them seem related to this warning (or more general, binding of buffers). Quest+Link:
Quest Browser: I think some of these might be related to the warning, at least from what we're seeing when the warning appears WebXR always breaks (in different ways). Still, these issues all don't quite belong in this thread, please let me know if there's a better place to continue this discussion. |
This isn't happening anymore with r144, OculusBrowser/23.1.0.3.50.396244958, hollywood:10/QQ3A.200805.001 |
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:
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 thegl.framebufferTexture2D( gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0,... );
inWebXRManager
. Ideally, the check would be something likeif (!xr.isPresenting || !areWebXrLayersEnabled)
, but I'm not sure what cleanest way is for determining if XR layers enabled in that class.Platform:
oculus/hollywood/hollywood:10/QQ3A.200805.001/17007100222900000:user/release-keys
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
The text was updated successfully, but these errors were encountered: