Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upHololens 2 rendering issues with Unity and WebXR - Regression? #27286
Comments
|
The demo can be found here: |
|
I can reproduce the AR clearing issues on non-UWP builds in our glwindow backend as well. |
|
This appears to be a regression from #26927, because the 6/27 nightly build does not show any of these issues. cc @asajeffrey |
|
This looks like our old friend depth/stencil. I'll investigate. |
|
I did not try with glwindow after #27232. |
|
OK, that means it's almost certainly depth/stencil. I'll apply a similar fix to the openxr layer manager that I did for the surfman layer manager. |
|
I reproduced the issue on the HL2, let's see if I can fix it. |
|
OK, I think there's two things going on here. The easy-to-fix one is to add a depth/stencil texture to each XR layer, which is servo/webxr#185. The harder-to-fix one is that there's GL errors being generated, which is what I think is causing the clear errors. |
|
Is it something on the Unity WebGL side? I'm limited with how much I can manipulate it |
|
No, it's a problem at our end:
GL commands are not meant to fail like this! |
|
The tail end of the WebGL commands:
|
|
I think what's going on is that when servo begins a frame, it calls |
|
I even wrote a servo/components/script/dom/xrwebgllayer.rs Line 232 in 9cd22a0 |
|
OK, I think #27316 should fix this. |
|
You people are AWESOME |
…shearth Save / restore state when updating opaque framebuffer bindings <!-- Please describe your changes on the following line: --> This saves and restores the WebGL bindings for texture and framebuffer when beginning a webxr frame. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #27286 - [x] These changes do not require tests because we don't reftest hololens (it would be nice if we did!) <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
…shearth Save / restore state when updating opaque framebuffer bindings <!-- Please describe your changes on the following line: --> This saves and restores the WebGL bindings for texture and framebuffer when beginning a webxr frame. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #27286 - [x] These changes do not require tests because we don't reftest hololens (it would be nice if we did!) <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
|
@De-Panther this fix should be in the next nightly, let us know if this fixed things! |
|
@asajeffrey sure! |
|
Correct. |
|
The render order issue was fixed, but the smearing is still there When clearing the framebuffer at the start of the frame, there's no smearing, but Handheld and Video see through devices require to not clear the framebuffer, as they show the camera image at the background... |
|
OK, reopening the issue. |
|
So hopefully this is fixed by #27373. It looks fixed with the surfman layer manager, I'm building the HL2 one atm. |
Updated webxr <!-- Please describe your changes on the following line: --> Updates webxr to clear the render target every frame. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #27286 (really this time) - [x] These changes do not require tests because we don't reftest webxr <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
|
The PR which hopefully fixes this has now landed, so the change should be in the next nightly build. @De-Panther: let me know if it's actually fixed this time! |
|
Can also confirm that it works on a device. Got a recording. |


In the current Firefox Reality in the Microsoft Hololens store, AR session works and rendered as intended.
But the nightly build version ( 13/07 ServoApp_1.1.0.0_x64_arm64 ), has some rendering issues:
Rendering order.
Smearing on transparent background.
I took screenshots from the emulator, but as I understood from people with the device, it's the same.
This is how it looks on the store version, you can see that the rendering order is right, and the transparent background is black (as the emulator doesn't show scene mesh by default):

This is how the same AR session looks in the nightly build. You can see the smearing of the numbers and other objects. You can also see some errors in rendering order, the hand model should be near the user and not behind the floating table:

This is how it looks when I tried to use

WebGLRenderingContext.clear(COLOR_BUFFER_BITDEPTH_BUFFER_BITand with and withoutSTENCIL_BUFFER_BIT) at the frame start. There's no smearing, but the hand is rendered behind the floating table:As far as I know, on AR mode we shouldn't use clear at the frame start, as in Handheld and Video see through devices, it has the camera image. If we use clear at the frame start, we won't see the camera image.