De-Panther / unity-webxr-export

Develop and export WebXR experiences using Unity WebGL
https://de-panther.github.io/unity-webxr-export/
Apache License 2.0
1.06k stars 111 forks source link

INVALID_FRAMEBUFFER_OPERATION when entering AR on Android #257

Closed sipkode closed 1 year ago

sipkode commented 1 year ago

When creating a project from scratch, and importing the WebXR-Export package, the following errors are seen in the Chrome log on Android, and no content is rendered, when attempting to enter AR mode:

WebGL.framework.js:1137 WebGL: INVALID_OPERATION: drawBuffers: BACK or NONE
_glDrawBuffers @ WebGL.framework.js:1137
WebGL.framework.js:1137 WebGL: INVALID_FRAMEBUFFER_OPERATION: drawElements: Cannot render to a XRWebGLLayer framebuffer outside of an XRSession animation frame callback.

I have tested on both Unity 2021.3.21f and 2020.3.46f1, and the problem reproduces on both.

If I copy and paste the sample projects from the DebugProject folder, however, it works fine. AFAICT, all of the project settings are the same between the fresh project and the sample project, and the scenes are identical.

De-Panther commented 1 year ago

If you can create a repo of a base project with the bug I can look at that. Also, as far as I know, those are warnings and not errors.

Did you use built-in render pipeline?

sipkode commented 1 year ago

Here's a link to the minimum repro project: https://github.com/sipkode/WebXRTest. And yep, using the built-in pipeline.

And yeah, those messages do appear to be warnings; however, they are present in the case that no content is rendered, but absent when rendering works correctly.

De-Panther commented 1 year ago

Sorry, I have not get to try your test scene, but I noticed in one of my own projects, that when I set the Color Space to Linear, I see only the device camera background in AR mode. Is it the same issue in your case? https://github.com/De-Panther/unity-webxr-export/issues/263

For now, you can use Gamma color space instead of Linear.

De-Panther commented 1 year ago

Closed as there was no comment. Looking at the ProjectSettings file in your repo, I see that it uses Linear color space.